To write a C program to find the length of the string .
1: Start the program.
2: Read a string input from the user and store it in a character array str with a maximum capacity of 100 characters.
3: Initialize a variable c to 0 to count the length of the string.
4: Iterate through each character ch in the str array, Increment c by 1.
5: Print the value of c as the length of the string.
6: Stop the program.
#include <stdio.h>
#include <string.h>
int main()
{
int i;
char str[10];
scanf("%s",str);
for(i=0;str[i]!='\0';i++);
printf("Length of Str is %d\n", i);
return 0;
}
Thus, the program is successfully verified.