C Program to Print Multiplication Table

C Program to Print Multiplication Table

C program to print multiplication table; In this tutorial, we will learn how to print multiplication table in c program with the help of for loop and while loop.

Programs to Print Multiplication Table in C

  • Algorithm of Print Multiplication Table
  • C Program to Print Multiplication Table using For Loop
  • C Program to Print Multiplication Table using While Loop

Algorithm of Print Multiplication Table

Use the algorithm to write a c program to print multiplication table; as follows:

  • Step 1: Start.
  • Step 2: Read the a number from the user.
  • Step 3: Iterate for or while loop.
  • Step 4: Print table of given number. 
  • Step 6:End.

C Program to Print Multiplication Table using For Loop

#include <stdio.h>
int main() {
  int n, i;
  printf("Enter an integer: ");
  scanf("%d", &n);
  for (i = 1; i <= 10; ++i) {
    printf("%d * %d = %d \n", n, i, n * i);
  }
  return 0;
}

The output of the above c program; as follows:

Enter an integer: 9
9 * 1 = 9
9 * 2 = 18
9 * 3 = 27
9 * 4 = 36
9 * 5 = 45
9 * 6 = 54
9 * 7 = 63
9 * 8 = 72
9 * 9 = 81
9 * 10 = 90

C Program to Print Multiplication Table using While Loop

#include <stdio.h>
int main()
{
   int n, i;
 
    printf("Enter a Number ");
    scanf("%d",&n);
    i=1;
    while(i<=10){
                
        printf("%d * %d = %d \n", n, i, n*i);
        ++i;
    }
     
   return 0;
    
}

The output of the above c program; as follows:

Enter a Number 12
12 * 1 = 12 
12 * 2 = 24 
12 * 3 = 36 
12 * 4 = 48 
12 * 5 = 60 
12 * 6 = 72 
12 * 7 = 84 
12 * 8 = 96 
12 * 9 = 108 
12 * 10 = 120 

Recommended C Programs

AuthorAdmin

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

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