What will be the values of ans, x, and y after the following statements are executed?
Int ans = 0, x = 15, y =25;
If ( x >= y)
{
Ans = x + 10;
X -=y;
}
Else
{
Ans = y + 10;
Y += x;
}
A) ans = 0, x = 15, y = 25
B) ans = 25, x = -10, y = 25
C) ans = 35, x = 15, y = 40
D) ans = 25, x = 15, y = 40
Correct Answer:
Verified
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
Q26: What will be printed when the following
Q27: _ works like this: If the expression
Q28: To do a case insensitive compare which
Q29: In an if/else statement, if the boolean
Q30: The expression tested by an if statement
Q54: Which of the following will format 12.78
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