43. Right-Angled Triangle Pattern
Foundation1000 ms256 MBSolved by 0%
Read an integer n and print a right-angled triangle of stars with
n rows. Row 1 has one star, row 2 has two, and so on.
*
**
***
****
No trailing spaces, and no blank line after the last row.
Constraints - `1 ≤ n ≤ 100`
Input
A single line containing one integer n.
Output
Print n lines: line i holds i asterisks. No trailing spaces, and no blank line after the last row.
Input4
Output*
**
***
****
Noteis the worked example from the statement
Input1
Output*
Noteis a single row with a single star and no newline after it
Hints
Four rungs, in order. The last two open once you have submitted an attempt. A wrong one counts.
Hint 1Where to start
Hint 2The approachOpen hint 1 first. This one carries on from it.
Hint 3PseudocodeOpen hint 2 first. This one carries on from it.
Hint 4Full solutionOpen hint 3 first. This one carries on from it.