Question: in c++, please rewrite the program below to recursive program . note: prompt user to enter an integer. Output should print out the integer reversely.

in c++, please rewrite the program below to recursive program. note: prompt user to enter an integer. Output should print out the integer reversely. e.g.: if user enters 12345, your output will be 54321. show output and i will upvote and leave positive comment

#include using namespace std;

int reverseMy(int n) { int rev=0, rem; while(n != 0) { rem = n % 10; rev = rev * 10 + rem; n /= 10; } return rev; }

int main() { int n, reverse;

cout<<"Enter a number : "; cin>>n; cout<<" The reverse of "<

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!