"KEEP LEARNING, DON'T STOP."
"KEEP LEARNING, DON'T STOP."
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.
#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(); }
ENTER A NUMBER TO PRINT A TABLE:- 2 2 4 6 8 10 12 16 18 20