Multiplication tables in C


This C program is used to display the multiplication table upto the given Number using for the for loop. A for loop is a repetition control structure which allows us to write a loop that is executed a specific number of times. The loop enables us to perform n number of steps together in one line. The three components of the for loop (separated by ;) are variable declaration/initialization (i = 1), the condition ( i <= n), and the increment statement ( i++).

Source Code

//Program to print multiplication tables in C Programming
 
#include<stdio.h>
 
int main()
{
    int i,t,n;
    printf("\nEnter The Table Name : ");
    scanf("%d",&t);//2
    printf("\nEnter The Limit      : ");
    scanf("%d",&n);//5
    for(i=1;i<=n;i++)
    {
        printf("\n%d X %d = %d",t,i,(t*i));
    }
    return 0;
}
 
To download raw file Click Here

Output

Enter The Table Name : 5

Enter The Limit      : 8

5 X 1 = 5
5 X 2 = 10
5 X 3 = 15
5 X 4 = 20
5 X 5 = 25
5 X 6 = 30
5 X 7 = 35
5 X 8 = 40

List of Programs


Sample Programs


Switch Case in C


Conditional Operators in C


Goto Statement in C


While Loop Example Programs


Looping Statements in C

For Loop Example Programs


Array Examples in C

One Dimensional Array


Two Dimensional Array in C


String Example Programs in C


Functions Example Programs in C