0
This is an answer provided in our book for this program: 6 5 5 4 4 4 3 3 3 3 2 2 2 2 2 1 1 1 1 1 1. Result is different. Help.
2 Respostas
+ 13
Do j >=i instead of 1
for (i=6;i>=1;i--) {
for (j=6;j>=i;j--)
document.write(""+i)
document.write("<br>")
}
+ 1
for (i=6;i>=1;i--) {
for (j=6;j>=i;j--)
document.write(""+i)
document.write("<br>")
}
try this, should work... a simple mistake, a number 1 instead of an "i" in second for loop :)