A special site for solving fun programming problems and challenges, interested in computer science, programming, basics, data structure and algorithms

 

 C++ Basic Solved Programs

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. 

 

SOURCE CODE :

#include <iostream>
using namespace std;

int main()
{
    int num;

    cout << "Enter number: ";
    cin >> num;

    cout << "\nThe Number entered is: " << num<<endl;
    return 0;
}

No comments:

Post a Comment