C Program To Show Lenght Of A Word Using Function And Array


♣ Try it Out ::
#include<stdio.h>
#include<conio.h>

int strLen(char *str)
{
    int len=0;
    for(int i=0; str[i]!='\0'; i++)
        len++;

    return len;
}

int main()
{
    char a[100];
    printf("Please enter a word: ");
    scanf("%s", a);
    int L = strLen(a);
    printf("\nLenght = %d", L);
    
    getch();	
    return 0;
}

♣ Output ::
Please enter a word: Muhit
Lenght = 5

♣ Downloads ::

Comments

Popular posts from this blog

C++ :: Topological Sort Algorithm (using DFS)

How to Hack Facebook Account

C++ :: Strongly Connected Components Algorithm (SCC)