Solved

Given the Nested If-Else Structure Below, Answer Questions Below

Question 6

Multiple Choice

Given the nested if-else structure below, answer questions below.
if (a > 0)
if (b < 0)
x = x + 5;
else
if (a > 5)
x = x + 4;
else
x = x + 3;
else
x = x + 2;
-If x is currently 0, a = 5 and b = 5, what will x become after the above statement is executed?


A) 0
B) 2
C) 3
D) 4
E) 5

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions