Given the following code segment, what is the output?
int x = 1, y = 1, z = 1;
y = y + z;
x = x + y;
cout << "result = " << (x < y ? y : x) << endl;
A) result = 0
B) result = 1
C) result = 2
D) result = 3
E) there will be no output
Correct Answer:
Verified
Q41: What is the output of the
Q42: When a program lets the user know
Q43: This statement uses the value of a
Q44: The default section of a switch statement
Q45: Given the if/else statement:
If (a < 5)
B
Q46: Input values should always be checked for
A)
Q47: Which line in the following program
Q49: Which statement allows you to properly check
Q50: Without this statement appearing in a switch
Q51: Given that x = 2, y =
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