Q. What will be the output of the following code snippet?
Code:var a = 1;
var b = 0;
while (a <= 3)
{
a++;
b += a * 2;
print(b);
}
β
Correct Answer: (A)
4 10 18
var a = 1;
var b = 0;
while (a <= 3)
{
a++;
b += a * 2;
print(b);
}
You must be Logged in to update hint/solution