Here's what I need to do:
In reverse order, print out the first num positive integers, with each integer being printed the number of times as its magnitude.
Basically, I'll use the number 9 as an example, I need to print 9 9's on one line, 8 8's on the second line, 7 7's, etc. all the way to 1.
I got it to print in reversed order but I don't know how I can print its magnitude. Here's my code now:
static void printReverse(int n) { for (int reverse = n; reverse = 1; reverse--) { System.out.println(reverse); } System.out.println(); // Leaves space between the outputs System.out.println();
printinstead ofprintln. Thelnstands for "line" and means "move to a new line after this".