Question: Given the following code: var a = 2, b = 3, c = 2; var i; for(i = 0; i < b; i = i

Given the following code:

var a = 2, b = 3, c = 2; var i; 
for(i = 0; i < b; i = i + 1) { c = b + 2; a = c + 1; 

}

if (c > a) b = b*2 - 1; 

Calculate the final values of: a _________

Given the code:

 var x = 4; var a = 0; var b = 1; var y; 

for (i = 2; i < x; i = i + 1) { y = a + b;

a = b;

b = y; }

Provide the final values for:

y __________

a _________

b __________

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!