Introduction to Java

Start Learning!

Using System.out.print() and System.out.println()

Basic For-Loop

Nested For-Loops

Advanced Nested For-Loops

Write a computer code that generates the following output:

111112
111122
111222
112222
122222

Write your code in the box below

Checklist

  • The outer for loop loops n times
  • The first inner for-loop loops i times
  • The second inner for loop loops j times
  • i + j is the number of characters on one line
  • n is the number of lines in the output
  • The outer for loop has two inner for-loops and a System.out.println() statement