[Solved] How could a for loop be applicated in this?


If you are a begginer, its good that you didnt copied ready solution from the internet : )
You just need to think more about it.

Solution is very simple, your program need to know

  • number of the line ‘you’ are currently at

  • how many X to print on that line

Your loop should print letters from 1 to n amount

for lineNo belonging to N [1-n]
   print `x` lineNo times

1

solved How could a for loop be applicated in this?