fork 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. printf("Nowe slowo to %s",out);
  24. }
  25.  
  26.  
  27. int main(void)
  28. {
  29. char out[1024];
  30. reverse(out);
  31.  
  32.  
  33.  
  34. return 0;
  35.  
  36. }
Success #stdin #stdout 0s 2296KB
stdin
Standard input is empty
stdout
Podaj slowo, ktorej chcesz odwrocic
Nowe slowo to