A

Admin • 833K Points
Coach

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);
}
  • (A) 4 10 18
  • (B) 1 2 3
  • (C) 1 4 7
  • (D) None of the above
  • Correct Answer - Option(A)
  • Views: 24
  • Filed under category JavaScript
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.