Taking User Input In C++

How To Take User Input ( cin ) In C++

Posted by Zohaib Qazi on may 15, 2017

Taking User Input In C++

After reading this post you will come to understand that what is cin. How to take user input in C++ with code plus theory. However, clear your concept by reading this post and watching our Balochi videos which is placed below.

cin In C++

cin is an object of istream class that is an object which is said to be attached to the standard input device, which usually is the keyword. and every cin follow two greater sign " >> ". " int VariableName;
cin>>VariableName;
cout << VariableName << endl;

Taking User Input In C++ Video In Balochi

Taking User Input In C++ Code by balochprogrammer


#include < iostream >
using namespace std;
int main()
{
int num1;
int num2;
cout << " Enter The First Number : " << endl ;
cin >> num1;
cout << " Enter The Second Number : " << endl ;
cin >> num2;
cout << " The Sum of Two Numbers You Entered : " << num1 + num2 << endl ;
return 0 ;
}