C++ Program to Print Integer

« Previous Program Next Program »

Print Integer in C++

To print integers in C++ programming, use cout<<integer of iostream.h library function.

Here, integer is the variable name that holds the integer value which is to be printed.

C++ Programming Code to Print Integer

Following C++ program prints the value of the variable num which holds an integer value:

/* C++ Program - Print Integers */
void main()
	int num=10;
	cout<<"The value of num is "<<num;

When the above C++ program is compile and executed, it will produce the following result:

C++ program print integer

Same Program in Other Language

You may like the same program in other programming languages:

« Previous Program Next Program »


Quick Links
Signup - Login - Give Online Test