Simple Program for Read user Input Using cin


Definition of Cin

The cin read input from the keyboard. The cin is the stream extraction operator (>>), which is mainly used for reading the input from the console.

Unlike C, cin reads all data types without any notation.

Syntax

cin >> varable_name;

Simple Program for read user Input (Integer) Using cin

/* Simple Program for Read user Input Using cin In C++ */
/* Add Two Integers Programs, Addition Programs,C++ Examples */

// Header Files
#include<iostream>
#include<conio.h>

//Main Function

using namespace std;

int main() {
   // Local Variable 'a' Declaration
   int a;

   cout << "Simple Program for Read user Input (Integer) Using cin \n";

   cout << "Enter Number : ";
   cin >> a;

   cout << "Entered Input Is = " << a;

   // Wait For Output Screen
   getch();

   //Main Function return Statement
   return 0;
}

Sample Output

Simple Program for Read user Input (Integer) Using cin
Enter Number : 100
Entered Input Is = 100