Prompt: Using nested loops output 10 math problems x+y that do not equal 69 or 42 for students using nested loops.
My attempt, any suggesting's would be helpful. It does works below but without nested loops.
for(var i =0; i < 10;i++)
{
var total;
var x;
var y;
while(total != 69 && total != 42)
{
while(x != 69 && x != 42)
{
x = Math.floor(Math.random() * 100);
if(x != 69 && x != 4)
{
break;
}
}
while(y != 69 && y != 42)
{
y = Math.floor(Math.random() * 100);
if(y != 69 && y != 42)
{
break;
}
}
if (total != 69 && total != 42)
{
break;
}
}
console.log(x + "+" +y);
};