0

How do I reverse the numbers in my program to produce the orginal numbers and the numbers in reverse?

int magic_box (int N)

{

int digit1, digit2, digit3;

digit1 = N / 100;

digit2 = N % 100 /10;

digit3 = N % 10;

return digit1 + digit2 * 10 + digit3 * 100;

}

Example

Enter a 3-digit integer and my magic box

will reverse the digits in your number for you: 739

My magic box has change your number 739 into 937