c program to calculate the length of the string without using library function

c program to calculate the length of the string without using library function




#include
#include
void main()
{
int i=0,cnt=0;
char str[50];
clrscr();
printf("\n Enter Any string=");
gets(str);
while(str[i]!=NULL)
{
i++;
}
printf("\n length of string is =%d",i);
getch();
}

No comments:

Post a Comment