Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
WHAT IS THE PROPER SOLUTION AND WHAT IS THE LOGIC?

What I have tried:

#include<iostream>
using namespace std;
int main()
{
	int x;
	cout<<"input a num to reverse:";
	cin>>x;
	for(int x=10;x>=1;x-- )
	{
		cout<<x<<endl;
	}


return 0;
}
Posted
Updated 10-Nov-22 8:09am
Comments
jeron1 10-Nov-22 14:15pm    
Could you solve this on paper?

1 solution

To do this, you will have to store the numbers as you read them from the user, and then print them out using a second loop in reverse order.

I'd suggest you start here: C++ Arrays[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900