program to find the length of a string through c
#include<stdio.h>
int main()
{
int c=0,i=0;
char string[50];
printf("\n enter a string:");
gets(string);
while(string[i]!='\0'){
c++;
i++;
}
printf("length of the string =%d",c);
return(0);
}
#include<stdio.h>
int main()
{
int c=0,i=0;
char string[50];
printf("\n enter a string:");
gets(string);
while(string[i]!='\0'){
c++;
i++;
}
printf("length of the string =%d",c);
return(0);
}
Post a Comment