C program to print multiplication table

Program to print multiplication table

C program to print multiplication table

The logic behind to print multiplication table is-

  • Take an Input from the user to generate a multiplication table. Store it in some variable say num.
  • To print the multiplication table we need to iterate from 1 to 10. Run a loop from 1 to 10, increment 1 on each iteration. The loop structure should look like for(i=1; i<=10; i++).
  • Inside loop generate multiplication table using num * i and print in a specified format.

Now move to the main part of the Program to Find & Display Multiplication table-

#include<stdio.h>
#include<conio.h>
void main()
{
    int i, num;
    clrscr();
    /* Input a number to print table */
printf("\n\t\t\t...Welcome To EduNews.Tech... ");
     
    printf("\n\nEnter a number to print table: ");
    scanf("%d", &num);

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

    }
    printf("\n\n\n\t\t\tThankyou for Joining Us !");
    printf("\n\t\t\t!Regards EduNews !");
   
    getch();
}

Program Output:

Multiplication output

I hope this post helps you to understand how to print the multiplication table and its implementation in C programming language.

Keep coding 🙂

1 thought on “C program to print multiplication table”

Leave a Reply

Your email address will not be published. Required fields are marked *