Question #176171

6. Which of the following is the correct syntax to read a sentence from the user and store in variable "name" in C++?


cin >> name;


getline(name, cin);


cout << name;


getline(cin, name);


Expert's answer

Answer:cin >> name;


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS