Multiple choice

Which of the following functions is used to input data from keyboard?

  1. cout

  2. cin

  3. cerr

  4. get

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

cin is the standard input stream object in C++ that is used to input data from the keyboard. It is part of the iostream library and is used with the extraction operator (>>) to read values into variables. cout is for output, cerr is for error output, and get is a specific method.