Home » Blog » Display Number Entered By User In C++

Display Number Entered By User In C++

cin>> is used to take value from the user. cout<< is used to print value.

#include <iostream>
using namespace std;

int main()
{    
    int no;

    cout << "Enter an integer value: ";
    cin >> no;

    cout << "You entered " << no;    
    return 0;
}

OutPut

Enter an integer value: 23
You entered 23

 

Leave a Reply

Your email address will not be published.