fork download
  1. //Q81. Count characters in a string without using built-in length functions.
  2. #include <stdio.h>
  3. int main() {
  4. char str[100];
  5. int i, count = 0;
  6. gets(str);
  7. for(i=0; str[i]!='\0'; i++)
  8. count++;
  9. printf("%d", count);
  10. }
  11.  
Success #stdin #stdout 0s 5320KB
stdin
Hello
stdout
5