fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. reverse(char out[1024])
  5. {
  6. int i,j;
  7. i = 0;
  8.  
  9.  
  10. printf("Podaj slowo, ktorej chcesz odwrocic\n");
  11. scanf("%s",out);
  12. j = strlen(out);
  13.  
  14. while (out[i]!=out[j])
  15. {
  16. out[i]=out[j];
  17. ++i;
  18. --j;
  19. printf("%c",out[j]);
  20.  
  21. }
  22.  
  23. }
  24.  
  25.  
  26. int main(void)
  27. {
  28. char out[1024];
  29. reverse(out);
  30.  
  31.  
  32.  
  33. return 0;
  34.  
  35. }
Success #stdin #stdout 0s 2252KB
stdin
Standard input is empty
stdout
Podaj slowo, ktorej chcesz odwrocic