c program to find length of the string

c program to find length of the string 

Here at this program you will learn how to calculate length of any string entered by user.

#include <stdio.h>
int main()
{
    char s[1000];
    int i;

    printf("Enter a string: ");
    scanf("%s", s);

    for(i = 0; s[i] != '\0'; ++i);

    printf("Length of string: %d", i);
    return 0;
}
c program to find length of the string


Comments

Popular posts from this blog

c program to convert any three digit number in words

c program to remove characters in string except alphabets