codescracker


c++

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 */
		
#include<iostream.h>
#include<conio.h>
void main()
{
	clrscr();
	int num=10;
	cout<<"The value of num is "<<num;
	getch();
}

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

C++ program print integer

Program Video with Compile and Run

Same Program in Other Language

You may like the same program in other programming languages:


« Previous Program Next Program »








Tools
Calculator

Quick Links
Signup - Login - Give Online Test