52.5k views
2 votes
You want the user to enter the length, width, and height from the keyboard. Which cin statement is correctly written?

A.
cin << length, width, height;

B.
cin.get(length, width, height);

C.
cin >> length >> width >> height;

D.
cin >> length, width, height;

User Deadlydog
by
6.9k points

1 Answer

7 votes

Answer:

Correct option is (C) that is cin >> length >> width >> height;.

Step-by-step explanation:

In the C++, for reading the input we use "cin>>" operator. If we have to read multiple input in the same line we can use this as "cin>>x>>y>>z;". it will read multiple input in the same line. "Cout<<" is use to print output in C++.To read multiple input, all the variables are separated by ">>" operator.To read multiple input we can separate variables

by ",".

Example:

cin>>x>>y>>z;

it will read three value in variables "x","y" and "z" respectively.