Hello, i'm learning to work with loops and it was fine untill it came to nesting loops. In an exersize, i was told to use nested loops to display a pattern of asterisks like this:
(2 asterisks, 4 asterisks, 6 asterisks, 8 asterisks, 10 asterisks, 12 asterisks)
**
****
******
********
**********
************
I tried everything in my knowlege, i tried to draw up an algorithm, sketch a flowchart, but i always got stuck at one point. I've made out that the first loop should control the lines (6) but i dont know how to control the asterisks per line. I coded many a algorithm but the result was bizzare designs, and an infinite loop that just kept typing asterisks :-\ .
Could someone just explain me through this and atleast just give me an algorithm so that i can code it myself. Coding the algorithm will make it clearer to me :)