Ans.
#include<stdio.h>
int
main() {
char str[20], *pt;
int i = 0;
scanf("Pointer Example Program : Find or
Calculate Length of String \n");
scanf("Enter Any string [below 20 chars]
: ");
gets(str);
pt = str;
while (*pt != '\0') {
i++;
pt++;
}
scanf("Length of String : %d", i);
return 0;
}
0 comments:
Post a Comment
Let us know your responses and feedback