C Program Of Strlen() Function

C Program Of Strlen() Function

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

main()
{

char ch[100];    //1D array of string
int len;

printf("Enter string:");
scanf("%s",ch);    //need not to write as &a bcuz it's a 1D array of character which contigucialy allocated

len=strlen(ch);    //entered string lenght return in len

printf("'%s' lenght is  %d\n",ch,len);

}

Related Posts