//Although There Are predefined Function for String But one Must Know what is the working #include int main() { char string[40],loop; int loop,size; gets(str); for(loop=0; loop<40; loop++) { if(str[loop]=='\0') break; else size=size+1;// alternativerly size++ } printf("size is %d",size); }