Q:

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

belongs to collection: C++ Basic Solved Programs

-1

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.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

  • 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 .

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Basic Solved Programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a C++ Program to Add Two Numbers... >>