Question

Consider carefully the program fragment below: int items = 5; ... if (items/2 == 2.5) cout...

Consider carefully the program fragment below:

int items = 5;
...
if (items/2 == 2.5)
cout << "items = 5\n";
else
cout << "items != 5\n";

What is its output?

Depends on the value of a at the time of execution of the if clause

item=5

item != 5

None of the Above

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The Answer is none of the above.

==========================================

Actually the output of the code is items=5.,But in options its given item=5.

so the answer will be none of the above.

If it is irrespective of item or items then the answer is item=5

Add a comment
Know the answer?
Add Answer to:
Consider carefully the program fragment below: int items = 5; ... if (items/2 == 2.5) cout...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT