Pages

Wednesday, March 26, 2014

C Program to demonstrate the use of strlen() function to find length of string

/*to use the strlen()*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>>
int main()
{
    char str[80];
    int l;
    printf("enter the string: ");
    gets(str);
    l=strlen(str);
    printf("length of the string=%d",l);
    system ("pause");
    return 0;
}

No comments:

Post a Comment