New answers tagged


in your code check the first for loop, why is the counter decreasing ? why do you need 4 for loops? to create the right aligned pyramid you need only 3 for loops. external loop, to count from the top of the pyramid down to the base first inner loop to print the dots or spaces, using -- second inner loop to print the #, using ++


Looks like you have an extra for loop there, which will cause the entire thing to loop l times when that's probably not what you intended.

Top 50 recent answers are included