FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 38   



Following program shows you how to find length of a string.
In this program we get string from user and prints the length using strlen()

#include <stdio.h>
#include <string.h>

int main(void) {
    char c[100];
    int input;

    printf("Please enter the string:");
    gets(c);

    input = strlen(c);

    printf("Length of the given string is: %d", input);
}

Output:

Please enter the string: tom
Length of the given string is: 3



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News