Perform multiplication table using C program

Perform multiplication table using C program blurnooz.com

C program to perform multiplication table of given number. Easily understand the C program of multiplication table using integer variable and for loop with proper output.

Example 1 : Write a program to display multiplication table.

PROGRAM :-

#include..........
#include..........
void main()
{
int a,i,m;
clrscr();
printf("Enter the value of multiplication table");
scanf("%d",&a);
for(i=1;i<=10;i++)
       {
            m=a*i;
            printf("\n %d * %d = %d",a,i,m);
       }
getch();
}

OUTPUT :-

Perform multiplication table using C program output - Blurnooz.com

 

Example 2 : Multiplication Table Up to a range (entered by the user)

PROGRAM :-

#include......... 
int main()
{
    int n, i, range;

    printf("Enter an integer: ");
    scanf("%d",&n);

    printf("Enter the range: ");
    scanf("%d", &range);

    for(i=1; i <= range; ++i)
    {
        printf("%d * %d = %d \n", n, i, n*i);
    }

    return 0;
}

OUTPUT :-

Enter an integer: 12
Enter the range: 8
12 * 1 = 12 
12 * 2 = 24 
12 * 3 = 36 
12 * 4 = 48 
12 * 5 = 60 
12 * 6 = 72 
12 * 7 = 84 
12 * 8 = 96 

Attachments

Leave a Reply

Please enter your comment!
Please enter your name here

*