[Solved] Do not understand how loop is determining how many asterisks to print


Simply put

asterisk < myArray[counter]

Means that it’s checking whether amount of asterisks is less than the value from myArray[counter].

So when you have
counter = 0
You also have
myArray[counter] = 12.

Which means in your inner for loop, it will print asterisks until asterisk is no longer lesser than 12. Thus, going from 0-11 will print 12 asterisks.

0

solved Do not understand how loop is determining how many asterisks to print