char *a,*b; int c,n,i;
printf(“enter the word to be find: “);
a=malloc(10*sizeof(char));
b=malloc(100*sizeof(char));
printf(“Address of b %d”,b);
fgets(a,10,stdin); puts(a);
i=0;
printf(“len of the str:%d \n”,strlen(a));
//for(i=0;*(a+i)!=”;i++)
while(*(a+i)!=”)
{
printf(“length= %d\n”,i);
printf(“length======== %c\n”,*(a+i));
i++;
}
hii
because at the end of every string complier always puts ” (NULL) character thts why ur loop count is always string+1