Question: a) If x = 0, y = 6, z =9, what is the value of x, y and z for each of the following code

a) If x = 0, y = 6, z =9, what is the value of x, y and z for each of the following code fragments? (Assume that x, y and z are their original values for each fragment.) i. if (z!=0) y= 2; else X = 10; ii. if (y + z > 9) { y = 4; z = 6; X+; } else X = 1; iii. if (x == 0) { x -= 3; Z -= 3; } else (9 Marks) b) If x=-1, y = 4, z = 7 and r = -2, what is the value for each of the following code fragments? i. X + y >z+r ii. X-2* y + y
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
