Which operator is used with cin to extract input from the standard input stream in C++?

Options

  • A. <<
  • B. >>
  • C. ::
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. >>

Detailed Explanation

Answer: (B) >>

The extraction operator (>>) is used with cin to take input from the standard input stream.

Example:

int age;
cin >> age;

Here, the user enters a value and the extraction operator transfers the input into the variable age.

Remember: cin >> is commonly used for formatted input, while cout << is used for output.