In this program, you will learn, how to print the number entered by a user using C++ cout statement. The program will ask to enter a number from the user and display that number on the screen.
Example: Print Number Entered by the User
using namespace std;
cout << "Enter an integer: ";
cin >> number;
cout << "You entered " << number;
Enter an integer: 12
You entered 12
When the user enters an integer, it is stored in the variable number using cin.
Then it is displayed on the screen using cout.