C program to find the length of a string

Program

#include<stdio.h>
#include<conio.h>

void main()
{
int i;
char str[50];
clrscr();
printf(“Enter a string:”);
gets(str);

for(i=0;str[i]!=’’;++i);
printf(“Lenth of string is %d”,i);
getch();
}

Output

Enter a string:JusttechReview
Lenth of string is 18

Leave a Comment

error: Alert: Content is protected!!