Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char *my_strrev(char *str)
- {
- int i;
- int j;
- char swap;
- i = 0;
- j = 0;
- while (str[i] != '\0')
- i++;
- i--;
- while (i > j)
- {
- swap = str[i];
- str[i] = str[j];
- str[j] = swap;
- i--;
- j++;
- }
- return (str);
- }
- int main()
- {
- printf("%s\n", my_strrev("hello Sbu!!!"));
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement