Input in C++ Read Courses Practice Video Improve Improve Improve Like Article Like Save Article Save Report issue Report The cin object in C++ is used to accept the input from the standard input device i.e., keyboard. it is the instance of the class istream. It is associated with the standard C input stream stdin. The extraction operator(>>) is used along with the object cin for reading inputs. The extraction operator extracts the data from the object cin which is entered using the keyboard. Program 1: Below is the C++ program to implement cin object to take input from the user: C++ // C++ program to demonstrate the // cin object #include <iostream> using namespace std; // Driver Code int main() { int i; // Take input using cin cin >> i; // Print output cout << i; return 0; } Input: Output: Note: Multiple inputs can also be taken using the extraction operators(>>) with cin. Program 2: Below is the C++ program to implement multiple inputs from the user: C++ // C++ program to demonstrate the taking // multiple inputs from the user #include <iostream> using namespace std; // Driver Code int main() { string name; int age; // Take multiple input using cin cin >> name >> age; // Print output cout << "Name : " << name << endl; cout << "Age : " << age << endl; return 0; } Input: Output: Last Updated : 01 Feb, 2021 Like Article Save Article Previous C++ Program to Read Content From One File and Write it Into Another File Next Colorizing text and console background in C++ Share your thoughts in the comments Add Your Comment Please Login to comment...