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 1 Question 93 Discussion

Actual exam question for C++ Institute's CPP exam
Question #: 93
Topic #: 1
[All CPP Questions]

What will happen when you attempt to compile and run the code below, assuming that you enter

the following sequence: 1.1 2.2 3.3?

#include

#include

using namespace std;

int main ()

{

int a,b,c;

cin>>a>>b>>c;

cout<

return 0;

}

Program will output:

Show Suggested Answer Hide Answer
Suggested Answer: C

Contribute your Thoughts:

Royal
16 days ago
Wait, did they just ask us to enter a secret code sequence to activate the compiler's hidden superpower? I bet the answer is 'Konami code' - up, up, down, down, left, right, left, right, B, A, start. That's the only way to get the real output, trust me.
upvoted 0 times
...
Luis
18 days ago
Ah, tricky question. I'm going to go with E - 'none of these'. There's got to be a catch here somewhere. Maybe the program will crash or output something completely unexpected. You can never be too sure with these certification exams.
upvoted 0 times
...
Dorothea
22 days ago
Hold on, I've got this! The answer has to be D - '1.1 2.2 3.3'. That's the exact input sequence, and the code doesn't seem to be doing any rounding or type conversion, so it should just print out the values as they were entered.
upvoted 0 times
...
Brianne
1 months ago
I don't know, man. This seems a bit tricky. Maybe the answer is C - '1.12.23.3'? The code is printing the values directly, so it might just concatenate the input as strings. But I could be totally off base here.
upvoted 0 times
Trina
23 days ago
I think the answer is B - '1 2 3'. The code will print the values of a, b, and c separated by spaces.
upvoted 0 times
...
...
Cristal
1 months ago
Hmm, this looks like a classic case of input/output mismatch. I bet the answer is B - '1 2 3'. The question clearly states that the input sequence is '1.1 2.2 3.3', but the code is only reading integers, so it should just print the whole numbers.
upvoted 0 times
...
Lawrence
2 months ago
I'm not sure about this. I think the program will output D) 1.1 2.2 3.3 because the input values are separated by spaces when entered.
upvoted 0 times
...
Julian
2 months ago
I agree with Dean. The code will output B) 1 2 3 because the cout statement does not include any spaces or separators between the variables.
upvoted 0 times
...
Dean
2 months ago
I think the program will output B) 1 2 3 because it will print the values of a, b, and c without any spaces in between.
upvoted 0 times
...

Save Cancel