In this example, We will learn how to print number entered by user. We will do this using cout and cin function.
In this example, Program will ask an number. After user entered number then it will print that number.
using namespace std;
cout << "Enter an integer: ";
cin >> number;
cout << "You entered : " << number;
The output of above program is
Enter an integer: 20
You entered : 20
Get the latest tutorials, examples and projects updates.
Ads Blocker Detected!!!
We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.
Disable Ad Block
Want Same System