One option might be to do this recursively, so the number will be printed in the correct order.
In this case, instead of a do / while loop, you will have a construction more similar to this, with the base case num = 0.
if(num==0) return; j = num % 10; c = j + '0'; my_int(num/10); my_char(c);
Edit: Noticed that you are not allowed to use recursion. It's a little ugly, but you can check the numbers in a number and then scroll back through the number.
To find the number of digits,
int digitDivide = 1; int tempNum = num; while(tempNum>0){ tempNum= tempNum/10; digitDivide=digitDivide*10; }
and then use this to scroll the number as follows:
digitDivide = digitDivide/10; while(digitDivide>0){ tempNum = (num/digitDivide)%10; c = j + '0'; my_char(c); digitDivide=digitDivide/10; }
source share