Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- void reverse(char t[]);
- int main(char s[])
- {
- reverse(s);
- printf("%s", s);
- return 0;
- };
- void reverse(char t[])
- {
- int i,j, count;
- char temp;
- for (i=0; t[i] != '\0'; i++)
- {
- count++;
- }
- j=count-1;
- while(i<j)
- {
- temp = t[i];
- t[i] = t[j];
- t[j]=temp;
- i++;
- j--;
- }
- };
Add Comment
Please, Sign In to add comment