In this post, I'll show how to find the length of string in C.
#include<stdio.h>
#include<string.h>
int main()
{
char str[20];
printf("Enter your string.\n");
gets(str);
int length = strlen(str);
printf("Length of string is %d",length);
return 0;
}
Comments
Post a Comment