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 CPP Exam - Topic 6 Question 42 Discussion

Posted by Cecily on May 03, 2022 at 05:04 PM

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

#include

#include

using namespace std;

int main ()

{

string a;

cin.getline(a);

cout<

return 0;

}

Program will output:

Suggested Answer: D

Get Premium CPP Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
8 comments · newest first
JU
Justa 11 months ago
I thought it would just take the first word.
TI
Titus 12 months ago
No way, it's not a compilation error!
GA
Gail 12 months ago
Wait, are you sure? What if it breaks?
SH
Shala 1 year ago
Definitely B, that's how getline works!
SY
Sylvie 1 year ago
It will output "one two three".
LA
Lavonna 1 year ago
This question seems straightforward, I'm pretty confident I can figure this out.
LO
Louis 1 year ago
This question seems straightforward. I'm pretty confident I can answer it correctly.
GL
Glory 1 year ago
I think the NCS 2000 Optical Service Channel might be built into the Transport System Controller, but I'm not entirely sure.
0/2000 characters

Save Cancel