Multiple Choice
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
Correct Answer:
Verified
Related Questions
Q1: The System.out.printf method formats a string and
Q12: If str1 and str2 are both Strings,
Q13: What will be the values of ans,
Q14: What would be the value of discountRate
Q15: What would be the value of bonus
Q16: A block of code is enclosed in
Q18: Which of the following is the correct
Q19: What would be the value of discountRate
Q21: In an if/else statement, if the boolean
Q22: What will be printed when the following