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)
cout << "true" << endl;
else
cout << "false" << endl;
A) Nothing will be displayed
B) false
C) x
D) true
Correct Answer:

Verified
Correct Answer:
Verified
Related Questions
Q3: This operator is known as the logical
Q6: What will the following segment of
Q7: What will following segment of code
Q8: What will the following segment of
Q9: These operators connect two or more relational
Q11: Which value can be entered to
Q17: Input values should always be checked for:<br>A)Appropriate
Q29: The default section is required in a
Q31: As a rule of style, when writing
Q42: When a program lets the user know