C++ Program to Print Number Entered by User

In this basic C++ program, we will have a look at the program to print the number entered by the user in the C++ programming language.

C++ Program to Print Number Entered by User

#include <iostream>
using namespace std;
int main()
{    
    int number;
    cout << "Enter an integer that you want to print on the screen: ";
    cin >> number;
    cout << "Wooah you entered:" << number;    
    return 0;
}

Output

Enter an integer that you want to print on the screen:51
Wooah you entered:51

cin is used to take the input from the user & cout is used to display the same on the screen.

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping cart