i have to create a DigitsDisplay application that prompts the user for a non negative integer and then displays each digit on a separate line like such
"Enter a positive integer: 789
7
8
9
so far i have
int num;
c.print ("Enter a postive number: ");
num = c.readInt ();
while (num > 0)
{
c.println (num % 10);
num = num / 10;
}
the output i get is the reversed of what is asked, so I get:
9
8
7
instead of:
7
8
9
so i was wondering if anyone could take a look at my program to see what i did wrong?