Basically, I want a loop to print this:
* *** *******
..and so on, so forth. Notice how the stars are increasing by, firstly, 2, then by 4. It was one star, then 3 (by 2), then 7 ( by 4)..and so on. The spacing is irrelevant to my code; I know how to manipulate the increase or decrease of white spaces. I will use dots instead of spacing, though.
The only thing I thought of is the sequence in which the 2,4,2,4.. series follows: 3 + Math.pow(-1, i) where i is an initialization variable in the main for loop.
Any thoughts on this? Thanks.


Sign In
Create Account

Back to top









