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<stdio.h> #include<conio.h> //PRINT A TABLE PROGRAM. void main() { int i, num, sum; clrscr(); printf("ENTER A NUMBER TO PRINT A TABLE:- "); scanf("%d",&num); for(i=1; i<=10; i++) { sum=i*num; printf("%d\n",sum); } getch(); }
ENTER A NUMBER TO PRINT A TABLE:- 2 2 4 6 8 10 12 16 18 20