C Program to Find Length of a String Using STRLEN()

include

include

main()
{
char s1[20];
int len;
printf(“\nEnter any string: “);
gets(s1);
len = strlen(s1);
printf(“\nLength of string: %d”, len);
getch();
}
OUTPUT:
Enter any string: programming9.com

Length of string: 16

Leave a Reply

Your email address will not be published.