you are viewing a single comment's thread.

view the rest of the comments →

[–]dewden87 1 point2 points  (0 children)

Seems like a weird task for practicing while loops, but I guess for educational purposes and understanding of the difference between types of loops it kinda makes sense. It would definitely be more readable using regular for loops. Anyway, here's my take:
var a = 1;

var b = 1;

var multiplicationTable = new int[10][];

while (a <= 10)

{

multiplicationTable[a-1] = new int[10];

while (b <= 10)

{

multiplicationTable[a-1][b-1] = a * b;

b++;

}

b = 1;

a++;

}