67.8k views
2 votes
What will be displayed after the following statements execute? int funny = 7, serious = 15; funny = serious % 2; if (funny != 1) { funny = 0; serious = 0; } else if (funny == 2) { funny = 10; serious = 10; } else { funny = 1; serious = 1; } cout << funny << " " << serious << endl;

User Zhiwei Li
by
5.0k points

2 Answers

3 votes

Answer:

11

Step-by-step explanation:

your welcome!

User Kourtney
by
5.5k points
3 votes

Answer:

1 1

Step-by-step explanation:

First we have funny = 7 and serious = 15 .Then after that remainder when serious is divided by 2 is stored in funny that is 1.if condition will be false because funny is equal to 1.else if condition will also be false because it is not 2.So else will be executed and funny =1 and serious =1.

Output=1 1

User Knittledan
by
4.9k points