#include<stdio.h>#include<string.h>main(){ char *name,*cptr; int len; printf("\n Enter a string:"); scanf("%s",&name); cptr=name; while(*cptr!='\0') cptr++; len=cptr-name; printf("\n Length of the string is %d",len); }
Standard input is empty
#include<stdio.h> #include<string.h> main() { char *name,*cptr; int len; printf("\n Enter a string:"); scanf("%s",&name); cptr=name; while(*cptr!='\0') cptr++; len=cptr-name; printf("\n Length of the string is %d",len); }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!