daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top