Author Question: What is the output of the following code segment? int x = 5;if (x = 2) cout (Read 76 times)

stephzh

  • Hero Member
  • *****
  • Posts: 556
What is the output of the following code segment?
int x = 5;
if (x = 2)
    cout << "This is true!" << endl;
else
    cout << "This is false!" << endl;
    cout << "That's all, folks!" << endl;

This is true!
That's all folks

This is false!
That's all, folks

This is true!
This is false!
That's all, folks!

This is true!
This is false!


fromAlphatoOmega22

  • Sr. Member
  • ****
  • Posts: 345
This is true!
That's all folks



Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
 

Did you know?

People about to have surgery must tell their health care providers about all supplements they take.

Did you know?

The first war in which wide-scale use of anesthetics occurred was the Civil War, and 80% of all wounds were in the extremities.

Did you know?

Methicillin-resistant Staphylococcus aureus or MRSA was discovered in 1961 in the United Kingdom. It if often referred to as a superbug. MRSA infections cause more deaths in the United States every year than AIDS.

Methicilli ...
Did you know?

The longest a person has survived after a heart transplant is 24 years.

Did you know?

Excessive alcohol use costs the country approximately $235 billion every year.

For a complete list of videos, visit our video library