Hi there. Struggling with this one. I'm to write a program that has this output:
0
10
210
3210
43210
543210
6543210
76543210
876542310
9876543210
Also, I can only have two print statements. One that prints a newline character and one that prints a single digit. I've rearranged my code numerous times and here is what I have now:
public class Loops
{
public static void main (String [] args)
{
for (int num0 = 0; num0 <= 9; num0++)
{
System.out.println();
for (int num1 = 9; num1 >= num0; num1--)
{
System.out.print(num1);
}
}
}
}
This will output:
9876543210
987654321
98765432
9876543
987654
98765
9876
987
98
9
I've also written the code to output:
0
01
012
0123
01234
012345
0123456
01234567
012345678
0123456789
Any help is greatly appreciated.