A

Admin • 36.96K 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: 184
  • Filed under category JavaScript

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.


Question analytics