Friday, November 21, 2014

count the length of a sentence ( string strlen function)

 

count the length of a sentence ( string strlen function)
#include<stdio.h>
#include<string.h>
int main()
{
    char a[50];
    scanf("%s",a);
    int l=strlen(a);
    printf("Length = %d\n",l);
    return 0;
}

No comments:

Post a Comment