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 = 50, y =100
B) ans = 60, x =0, y =50
C) ans = 45, x = 50, y = 0
D) ans = 45, x = 50, y = 50
Correct Answer:
Verified
Q13: A flag may have the values:
A) 0
Q14: What will be the value of ans
Q15: A Boolean expression is one that is
Q16: Which one of the following is the
Q19: What will be the value of bonus
Q20: If you prematurely terminate an if statement
Q21: Enclosing a group of statements inside a
Q22: Which of the following correctly tests the
Q23: What will be the value of pay
Q46: Which of the following expressions will determine
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents