# Chapter 4 - Selections - Section 4.7 - Nested if and Multi-Way if-elif-else Statements - Check Point - MyProgrammingLab - Page 104: 4.11

For x=3 and y=2 : x is 3 For x=3 and y=4 : z is 7 For x=2 and y=2 : No Output

#### Work Step by Step

For x=3 and y=2: The condition for the first if statement will be true because x>2 but the condition for the nested if statement will be false as y is not less than 2, so the control will go to the else statement and "x is 3" will be printed. For x=3 and y=4: The condition for the first if statement will be true because x>2 so the control will go inside and the condition for the nested if statement will also be true as y>2, then z will be calculated as x+y and after that the value of z will be printed as "z is 7" For x=2 and y=2: The condition for the first if statement will be false as x>2 is false hence the control will not go inside and since there is nothing after this if statement the program will end with no output.

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.