Guest User

Untitled

a guest
Aug 10th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. void reverse(char t[]);
  6.  
  7. int main(char s[])
  8. {
  9. reverse(s);
  10. printf("%s", s);
  11. return 0;
  12. };
  13.  
  14. void reverse(char t[])
  15. {
  16. int i,j, count;
  17. char temp;
  18. for (i=0; t[i] != '\0'; i++)
  19. {
  20. count++;
  21. }
  22. j=count-1;
  23. while(i<j)
  24. {
  25. temp = t[i];
  26. t[i] = t[j];
  27. t[j]=temp;
  28. i++;
  29. j--;
  30. }
  31. };
Add Comment
Please, Sign In to add comment