// Marty Stepp, CSE 142, Autumn 2008 // This program uses nested for loops to print the following pattern: // // ....1 // ...2 // ..3 // .4 // 5 public class NestedLoops { public static void main(String[] args) { // outer "vertical" loop for each line for (int line = 1; line <= 5; line++) { // inner "horizontal" loop for repeated characters within the line for (int j = 1; j <= -1 * line + 5; j++) { System.out.print("."); } System.out.println(line); // print number, end line of output } } }