writing an integer backwards

I've been given the challenge of writing an integer backwards. The barrier I've hit hard is trying to extract a single digit from the number.

basically I have to take a number:
1234

then write backwards

4321.

I just dont know how to access these numbers individually. Additionally, I'm constrained to integers, I cant use arrays.
Hint: You are thinking about the decimal system here. In the decimal system, every digit has a value of (digitnumber * 10^(position from the right starting at 0)).
Hint 2: In C++, the '/' operator is a division with remainder when used on integers.
Hint 3: In C++, the '%' operator retrieves the remainder of a division.
Last edited on
Topic archived. No new replies allowed.