Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main(void)
- {
- char word [31]; //for Q3, change to -> char sentence[51]
- cout << "Enter a word: "; //for Q3 change word to sentence
- cin >> word; //for Q3, change to -> cin.get(sentence, 51)
- int len = strlen(word); //for Q3, change word to sentence
- cout << "The word printed backwards: "; //for Q3, change word to sentence
- for(int i = len -1; i >= 0; i++)
- cout << word[i]; //for Q3, change word to sentence
- cout<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement