OK I'm embarrassed I have to ask this but I'm stuck so here we go, please nudge me in the right direction. We need to create this using a nested loop:
*
**
***
****
*****
Here's what I came up with.
int row,col;
for(row = 5; row >= 1; row--)
{
for (col = 0; col < 5 - row; col++)
println("");
for(col = 5; col >= row; col--)
print("*");
}
It ALMOST works but it prints spaces between each row and I cannot for the life of me figure out why.