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:
Verified
Q4: If str1 and str2 are both String
Q15: The if-else statement will execute one group
Q22: The _ statement is used to create
Q23: What will be displayed after the following
Q23: A _ is a boolean variable that
Q29: What will be displayed after the following
Q34: Which of the following statements determines whether
Q35: What will be the value of x
Q36: What will be the value of ans
Q56: Which of the following expressions will generate
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