fork download
  1. #include<stdio.h>
  2. #include<string.h>
  3. main()
  4. {
  5. char *name,*cptr;
  6. int len;
  7. printf("\n Enter a string:");
  8. gets(name);
  9. cptr=name;
  10. while(*cptr!='\0')
  11. cptr++;
  12. len=cptr-name;
  13. printf("\n Length of the string is %d",len);
  14.  
  15. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
 Enter  a string:
 Length of the string is 1