Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #using namespace std;
- char word[32] = "Backward";
- void reverse (char srt[], int j, int k) {
- char temp;
- if (j < k) {
- temp = str[j];
- str[j] = str[k];
- str[k] = temp;
- reverse(str, j + 1, k - 1);
- } // ra 2
- }
- int main() {
- reverse (word, 0, 7);
- cout << word << endl; // ra1
- return 0;
- }
Add Comment
Please, Sign In to add comment