Loading...
Loading...
Loading...
Print a staircase of stars with n rows. Row 1 has one star, row 2 has two stars, and so on, up to n stars in the last row. There are no spaces between the stars.
*).Example
Input
4
Output
* ** *** ****
Each row has one more star than the row above.
Try the problem first. Open one hint at a time.
The outer loop picks the row i, from 1 to n.
The inner loop prints i stars with print, and println() after it ends the row.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor