Course Solutions Uncategorized (Solved) : Hello Code Reverses String Possible Manipulate Reverse Integer Instead String Like Type Nu Q30342192 . . . .

(Solved) : Hello Code Reverses String Possible Manipulate Reverse Integer Instead String Like Type Nu Q30342192 . . . .

 

Hello, this code reverses a string.

Is it possible to manipulate it to reverse an integer instead ofa string? like to type in some numbers 123 and their reverse willbe 321.

Thanks!

#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;

int main(){
  
string str;
  
cout << “Enter a string: “;
getline(cin, str);
cout << “The string you entered in reverse order is: “;

for (int i = str.size()-1; i>=0; i–){
cout << str[i];   
}
return 0;
}

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Get Solution Find Reposts Hacmve Uploaded Tge Relavebt Description Scaffold Code C Languag Q29695043 . . . .(Solved) : Get Solution Find Reposts Hacmve Uploaded Tge Relavebt Description Scaffold Code C Languag Q29695043 . . . .

<p dir="ltr"><img src="https://media.cheggcdn.com/media%2F819%2F8198eb94-6a9c-4167-8107-6bae91dd7f27%2Fimage" alt="710 Find all reposts (Query) Given a post id, find all reposts of the given post (this can also be reposts of a repost and so on)