Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute Exam CPP Topic 3 Question 81 Discussion

Actual exam question for C++ Institute's CPP - C++ Certified Professional Programmer exam
Question #: 81
Topic #: 3
[All CPP - C++ Certified Professional Programmer Questions]

What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: true true?

#include

#include

using namespace std;

int main ()

{

bool a,b;

cin>>a>>b;

cout<

return 0;

}

Program will output:

Show Suggested Answer Hide Answer
Suggested Answer: E

Contribute your Thoughts:

Karl
21 hours ago
Ooh, I think I've got it! The key is going to be how the booleans are interpreted when we print them out. I bet the output is going to be something really weird and unexpected.
upvoted 0 times
...
Caitlin
3 days ago
You know, I'm starting to get a headache just looking at this code. Why do they always make these questions so convoluted? Straightforward code is all I want, is that too much to ask?
upvoted 0 times
...
Phung
4 days ago
Okay, let's think this through step-by-step. We're reading two boolean values, and then printing them out. Hmm, I wonder if the output will be formatted in a way we're not expecting.
upvoted 0 times
...
Giuseppe
5 days ago
Ha! I bet the answer is something ridiculous, like 'none of these'. These exam questions are always trying to trip you up. I'm not falling for it this time!
upvoted 0 times
...
Ivory
7 days ago
Ah, the age-old 'bool input and output' conundrum. I wonder if they're trying to catch us out with some unexpected behavior. I'll have to give this some serious thought.
upvoted 0 times
...
Leota
8 days ago
Hmm, this is a tricky one. I've seen similar questions before, and they can be quite deceptive. I'm not sure what the output will be, but I'll have to carefully think through the logic.
upvoted 0 times
...

Save Cancel