QuestionSet1
QuestionSet1
1
1. Think about rows and columns - The pattern has 5 rows, and each row has
numbers from 1 up to that row number.
12 2. Use nested loops - One loop will control the rows, and another loop inside it
will control the numbers printed on each row.
123 3. Outer loop - Runs from 1 to 5 to print each row.
4. Inner loop - Runs from 1 to the current row number to print numbers
1234 sequentially.
5. Print vs. Printin - Use print to stay on the same line and println to move to the
12345 next row.