Question: 1. Use the following code to answer the three parts of the problem below. int x,y,z;
1. Use the following code to answer the three parts of the problem below.
int x,y,z;
x=1 ; y = 2;
if (!( x >= y ) || ( ((x + 1) < 3 )) ) {
if (x < 5 && y > 2 ) {
z= 10;
} else {
z = 20;
}
} else if ( (x + y) < (x / y) ) {
z = x - y; }
else {
z = 7;
}
a. What would be the value of z for initializations of x=1 , y = 2 as shown
b. What would be the value of z for initializations of x=2 , y = 3 in second line of code.
c. What would be the value of z for initializations of x=3 , y = 3 in second line of code.
Step by Step Solution
There are 3 Steps involved in it
a What would be the value of z for initializations of x1 y 2 as shown C language int xyz x1 y 2 if x y x 1 2 z 10 else z 20 else if x y x y z x y else z 7 Output 10 Explanation The first condition in ... View full answer
Get step-by-step solutions from verified subject matter experts
