Program to print the multiplication table
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int i, t, n;
clrscr();
printf("Enter the table : ");
scanf("%d", &t);
printf("\nEnter the limit : ");
scanf("%d", &n);
printf("\nThe table is :\n\n");
for(i = 1 ; i <= n ; i++)
printf("%4d x %4d = %4d\n", i, t, i * t);
getch();
}
Output:
Enter the table : 5
Enter the limit : 15
The table is :
1 x 5 = 5
2 x 5 = 10
3 x 5 = 15
4 x 5 = 20
5 x 5 = 25
6 x 5 = 30
7 x 5 = 35
8 x 5 = 40
9 x 5 = 45
10 x 5 = 50
11 x 5 = 55
12 x 5 = 60
13 x 5 = 65
14 x 5 = 70
15 x 5 = 75
-
UpdatedDec 30, 2019
-
Views8,307
You May Like
Program to maintain employee details using structures
Program to maintain student details using structures
Check whether the person is eligible to vote or not
Print the numbers that are divisible by a given no.
Program to generate magic square
To sort the given numbers in ascending & descending order