Print table program in c++.

In this section you will learn how to print a table of given number. Here we will apply multiplication operation to print the table. We will take the input from user.

How program will work?

Program of print table in c++.


	#include<iostream.h>
	#include<conio.h>
		
	//PRINT A TABLE PROGRAM.
	void main()
	{
		int i, num, sum;
		clrscr();
		
		cout<<"ENTER A NUMBER TO PRINT A TABLE:- ";
		cin>>num;
		
		for(i=1; i<=10; i++)
		{
			sum=i*num;
			cout<<sum<<"\n";
		}
		
		getch();		
	}
	

Output:


	ENTER A NUMBER TO PRINT A TABLE:- 2
	2
	4
	6
	8
	10
	12
	16
	18
	20

Post Your Comment