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

Each year in the United States, there are approximately six million pregnancies. This means that at any one time, about 4% of women in the United States are pregnant.

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.

Did you know?

Although the Roman numeral for the number 4 has always been taught to have been "IV," according to historians, the ancient Romans probably used "IIII" most of the time. This is partially backed up by the fact that early grandfather clocks displayed IIII for the number 4 instead of IV. Early clockmakers apparently thought that the IIII balanced out the VIII (used for the number 8) on the clock face and that it just looked better.

Did you know?

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

Did you know?

The average adult has about 21 square feet of skin.

For a complete list of videos, visit our video library