Author Question: What is the output of the following code segment? int x = 5;if (x = 2) cout (Read 21 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?

During the twentieth century, a variant of the metric system was used in Russia and France in which the base unit of mass was the tonne. Instead of kilograms, this system used millitonnes (mt).

Did you know?

Before a vaccine is licensed in the USA, the Food and Drug Administration (FDA) reviews it for safety and effectiveness. The CDC then reviews all studies again, as well as the American Academy of Pediatrics and the American Academy of Family Physicians. Every lot of vaccine is tested before administration to the public, and the FDA regularly inspects vaccine manufacturers' facilities.

Did you know?

Immunoglobulin injections may give short-term protection against, or reduce severity of certain diseases. They help people who have an inherited problem making their own antibodies, or those who are having certain types of cancer treatments.

Did you know?

Critical care patients are twice as likely to receive the wrong medication. Of these errors, 20% are life-threatening, and 42% require additional life-sustaining treatments.

Did you know?

The familiar sounds of your heart are made by the heart's valves as they open and close.

For a complete list of videos, visit our video library