Solved

What Will Be the Output of the Following Code Segment \quad

Question 3

Multiple Choice

What will be the output of the following code segment after the user enters 0 at the keyboard?
int x = -1;
cout << "Enter a 0 or a 1 from the keyboard: ";
cin >> x;
if (x)
\quad cout << "true" << endl;
else
\quad cout << "false" << endl;


A) Nothing will be displayed
B) false
C) x
D) true

Correct Answer:

verifed

Verified

Related Questions