fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main() {
  4. char name[50];
  5. printf("Tell me a word: \n");
  6. scanf("%s", name);
  7. int i;
  8. for (i = 0; name[i] != '\0'; i++);
  9. if (name[i] == '\0') printf("The number of letters is %d\n", i);
  10. printf("The word is the reverse order is\n");
  11. for (int j = i; j >= 0; j--) printf("%c", name[j]);
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/172967/101
Success #stdin #stdout 0s 4508KB
stdin
teste
stdout
Tell me a word: 
The number of letters is 5
The word is the reverse order is
etset