Write a C++ Program to Display Number (Entered by the User)

By | 23.12.2016

Display Number (Entered by the User)


Write a C++ Program to Display Number (Entered by the User). Here’s simple Program to Print Number (Entered by the User) in C++ Programming Language.


  • This program asks user to enter a number.
  • When user enters an integer, it is stored in variable number using cin.
  • Then it is displayed in the screen using cout.

Here is source code of the C++ Program to Display Number (Entered by the User). The C++ program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.


SOURCE CODE : :


/*  C++ Program to Display Number (Entered by the User)  */

#include <iostream>
using namespace std;

int main()
{
    int number;

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

    cout << "\nThe Number entered is :: " << number<<"\n";
    return 0;
}

Output:


/*  C++ Program to Display Number (Entered by the User)  */

Enter an integer :: 8

The Number entered is :: 8

Process returned 0

Above is the source code for C++ Program to Display Number (Entered by the User) which is successfully compiled and run on Windows System.The Output of the program is shown above .

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post….

4.6 30 votes
Article Rating
Category: Basic Programs C++ Programming

About Tunde A

My name is Tunde Ajetomobi, a Tech Enthusiast and Growth Hacker. I enjoy creating helpful content that solves problem across different topics. Codezclub is my way of helping young aspiring programmers and students to hone their skills and find solutions on fundamental programming languages.

Subscribe
Notify of
guest

6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Alexis Siobhan Douglas

Thank you for making this. This is greater than my college textbook. Please pitch this to Khan Academy. <3

Alazar

When we enter decimal number it doesn’t display why?

Hunter

Use float variable.

I'M NEW

Where to write the source code to practice?

mazen tarek moahemd el sayed

it doesnt run

Mufti

Hi guys