

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Read and Print an Integer value in C++
Here we will see how to read integer from user and display in C++. To take input we will use the cin operator, and to display we will use cout operator. The syntax will be like −
Input −
int x; cin >> x;
Output −
int x = 110; cout << x;
Example
#include<iostream> using namespace std; int main(int argc, char const *argv[]) { int x; int y = 50; cout << "Enter some value: "; cin >> x; cout << "The given value is: " << x << endl; cout << "The value of y is: " << y; }
Output
Enter some value: 100 The given value is: 100 The value of y is: 50
- Related Questions & Answers
- Java Program to Print an Integer
- How to read an input image and print it into an array in matplotlib?
- How to convert an integer to an ASCII value in Python?
- Java program to accept an integer from user and print it
- How to print integer array in android Log?
- How to read an input value from a JTextField and add to a JList in Java?
- How to read data from one file and print to another file in Java?
- How to read value from string.xml in Android?
- Python Program to Read Two Numbers and Print Their Quotient and Remainder
- Golang Program to Read Two Numbers and Print their Quotient and Remainder
- C# Program to convert a Double to an Integer Value
- How to print NumberLong value in MongoDB?
- Print pair with maximum AND value in an array in C Program.
- C++ Program to print unique integer pairs
- In MySQL, how can we represent the time value as an integer?
Advertisements