← Quiz: C++ Introduction: all 10 questions
Quiz: C++ Introduction · Question 7 of 10
The user types Ravi Kumar for the statement cin name; (name is a string). What does name hold?
The user types Ravi Kumar for the statement cin >> name; (name is a string). What does name hold?
- A."Ravi Kumar"
- B."Kumar"
- C."Ravi"
- D.An empty string
Answer & explanation
Correct answer: "Ravi"
cin >> stops reading at the first space; use getline to read the whole line.
Can you get the rest right without peeking?
Take the timed Quiz: C++ Introduction quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →