I'm trying to make a grid of stars with a nested while loop.
It does work with a for loop:
for(m = 1; m <= 5; m++) {
for(n = 1;n <= 10; n++) {
document.write("*" + " ");
}
document.write("<br>");
}
but I can't figure out how I can solve it with a while loop:
while(m <= 5) {
while(n <= 10) {
document.write("*" + " ");
n++;
}
document.write("<br>");
m++;
}
Does anyone have any idea?
Thnx
nandmanywhere?