#include <stdio.h>
#include<conio.h>
int main()
{
char s[100],i;
clrscr();
printf("\n\n program to calculate length of string without strlen");
printf("\n Enter a string: ");
scanf("%s",s);
for(i=0; s[i]!='\0'; i++);
printf("\n Length of string: %d",i);
getch();
}
No comments:
Post a Comment
Guys if you think something is wrong or should be edit than please do comment.