0

How did this work?

I just started learning java for about a week and I was baffled by this one, can anybody explain to me how the output of solo learn's example is a triangle? Thanks in advance. https://code.sololearn.com/c3I8ORHVAVHQ/?ref=app

18th Aug 2019, 3:01 PM
gabriel dale reed
gabriel dale reed - avatar
2 Answers
+ 2
This results from the nested loop. A nested loop is a loop inside a loop. The inner loop draws the stars per line. The outer loop increases the number of stars per line and prints a linefeed after each line.
18th Aug 2019, 3:11 PM
Michael
Michael - avatar
0
Thanks
18th Aug 2019, 3:27 PM
gabriel dale reed
gabriel dale reed - avatar