Hey,
I was just thinking and came across this idea and wanted to know if it could be done, say if the user enters 321, my program would output 123, 450, 054 etc etc

Could you please show me how this could be achieved thanks.

>wanted to know if it could be done
If you find yourself asking if "<insert something here> can be done in C++", just go ahead and assume the answer is yes. It probably is.

>Could you please show me how this could be achieved thanks.
How about I tell you and you try it out on your own?

Solution 1: Convert the number into a string and reverse the string.
Solution 2: Use number % base to extract the least significant digit and print it until the number is 0. This method gives you the digits in reverse by default.

A hint, divide a number by 10. The quotient would be the number except for the least significant digit and the remainder would be the least significant digit. Use these two in combination to get your answer

>about how this could be achieved i meant solutions
I gave you two solutions. The code is trivial.

>for "number % base" would i change them to my variable names
If you want it to work. In particular, if I have an integer called value and I want the least significant base 10 digit, I would say value % 10 .

Why don't you actually try these things instead of look for existing code and expecting handouts? You'll learn a lot more that way.

[edit]
It's terribly rude to replace your post with something completely different after submitting it.
[/edit]

Sorry about cout, i've altered the %'s to be 10, but i get how i get the last digit, it's just the other two i'm not sure how to get even with your solutions i'm not very good

I edited my code and used hammerheads code, and when i inputted 123 it outputted 000.

#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
unsigned int number, number2, number3;
cout << "Enter number to reverse : ";
cin >> number;
number = number % 10;
number = number/10;
number2 = number % 10;
number = number/10;
number3 = number % 10;
cout << endl << number << number2 << number3;
getch();
}

You are not using your head and instead simply copy pasting the code. If you had read any of the posts above the mistake in my code would have been clear to you.

Wow, just wow. Here's the code you wanted, not that I think it'll help you any:

#include <iostream>
int main()
{
int value;
std::cout<<"Enter a number: ";
if ( std::cin>> value ) {
// The loop stops on 0, so
// treat it as a special case
if ( value == 0 )
std::cout<< value <<'\n';
else {
while ( value != 0 ) {
std::cout<< value % 10 <<'\n';
value /= 10;
}
}
}
}

>Thank you all!
Don't confuse the desire to help with the desire to shut you up. Personally, I don't see you getting very far with programming if you can't work these kinds of things out even after being told exactly how to do it.

I want to implement undo logic which deletes the last drawn shape. To test this logic i had cleared shapes list and redrawn all shapes but still last ...