How to get user input in C++?
Here you need to use IOStream function
CIn >>CIn is used to get input from the user but before it, You need to declare a variable in which you can serve your user value.
Note: "using namespace std" is important to add. It is used to add standard functions.If you are thinking about
<<So it is used as concatenation like in PHP dot operator performs
/*
Name: cin function in C++
Copyright: sameearticles.blogspot.com
Author: Samee Ullah Feroz
Date: 26/01/14 23:39
Description: How to get user input in C++?
*/
#include <iostream>
int main() //it is actually a function here
{
using namespace std;
int saminum; //we need to daclare a variable....
cout << "What is your age?" << endl; // << is as concatination remind it.
cin >> saminum;
cout << "My age is = " << saminum << "\n";
saminum = saminum + saminum;
cout << "double is = " << saminum << endl << "Enter to close it.";
system("pause");
return 0;
}






