Solved

What Will Be the Values of Ans, X, and Y

Question 8

Multiple Choice

What will be the values of ans, x, and y after the following statements are executed?
int ans = 35, x = 50, y = 50;
If (x >= y)
{
Ans = x + 10;
X -= y;
}
Else
{
Ans = y + 10;
Y += x;
}


A) ans = 60, x = 0, and y = 50
B) ans = 45, x = 50, and y = 0
C) ans = 45, x = 50, and y = 50
D) ans = 60, x = 50, and y = 100

Correct Answer:

verifed

Verified

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

Related Questions