fork(5) download
  1. #include <stdio.h>
  2. void wrt_it (void);
  3. int main (void)
  4. {
  5. //char a[5]="ABCDE";
  6. //printf("%s",a);
  7. printf ("Enter some text : \n");
  8. wrt_it();
  9. printf ("\n");
  10. return 0;
  11. }
  12. void wrt_it (void)
  13. {
  14. int c;
  15. if ((c = getchar())!='\n')
  16. wrt_it();
  17. putchar(c);
  18. }
Success #stdin #stdout 0s 2172KB
stdin
1 2 3 4
stdout
Enter some text : 

4 3 2 1