#include <stdio.h>
int main()
{
char str[100];
int len=0,i=0;
printf("Please Enter Massage: ");
gets(str);
for(i=0;str[i]!='�';i++) ///checking the string until NULL character
{
len++;
}
printf("Your Massage Length is: %d",len);
return 0;
}
Output
Please Enter Massage: Apple
Your Massage Length is:5
Add your comment