Program to Print Number Entered by User

0 Suresh Chand March 28, 2021

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.

Print Number Entered by User

#include <iostream>
using namespace std;

int main()
    int number;

    cout << "Enter an integer: ";
    cin >> number;

    cout << "You entered : " << number;    
    return 0;

The output of above program is

Enter an integer: 20
You entered : 20
Notify of
Inline Feedbacks
View all comments

Join Our Newsletter Now

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