CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Nested Loop Pattern

Java code walkthrough · Question 4
mediumLoops

Code

Read carefully. What does this print?
1public class Main {
2 public static void main(String[] args) {
3 for (int i = 1; i <= 3; i++) {
4 for (int j = 1; j <= i; j++) {
5 System.out.print("* ");
6 }
7 System.out.println();
8 }
9 }
10}

Your answer