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

About 600,000 particles of skin are shed every hour by each human. If you live to age 70 years, you have shed 105 pounds of dead skin.

Did you know?

Although not all of the following muscle groups are commonly used, intramuscular injections may be given into the abdominals, biceps, calves, deltoids, gluteals, laterals, pectorals, quadriceps, trapezoids, and triceps.

Did you know?

It is difficult to obtain enough calcium without consuming milk or other dairy foods.

Did you know?

Patients who have been on total parenteral nutrition for more than a few days may need to have foods gradually reintroduced to give the digestive tract time to start working again.

Did you know?

Although puberty usually occurs in the early teenage years, the world's youngest parents were two Chinese children who had their first baby when they were 8 and 9 years of age.

For a complete list of videos, visit our video library