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

1 Expert Approved Answer
Step: 1 Unlock

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

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 Programming Questions!