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, y = 50
B) ans = 45, x = 50, y = 0
C) ans = 45, x = 50, y = 50
D) ans = 60, x = 50, y = 100
Correct Answer:
Verified
Q21: What will be the value of pay
Q22: The _ statement is used to create
Q23: A _ is a boolean variable that
Q24: What will be the value of x
Q25: Which of the following expressions determines whether
Q27: In Java, when a character is stored
Q28: What will be the value of bonus
Q29: The boolean expression in an if statement
Q30: What will be displayed after the following
Q31: What will be the value of discountRate
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