C

Multiplication Table Program in C Using For Loop

In this tutorial, we are going to see how to print multiplication table in C using for loop. The program below asks the user to enter an integer value and generate the multiplication table. So we will write a C program to print the multiplication table of any number.
100-multiple-choice-questions-in-c-programming100 Multiple Choice Questions In C Programming – Part 1This collection of 100 Multiple Choice Questions and Answers (MCQs) In C Programming : Quizzes & Practice Tests with Answer focuses on “C Programming”.  …Read More

Multiplication Table Program in C Using For Loop
#include <stdio.h>

int main()
{
    int nbr, i;
    
    printf("Enter an integer: ");
    scanf("%d",&nbr);
    
    printf("\n Multiplication table of %d is: \n", nbr);
    for(i=1; i<=10; ++i)
    {
        printf(" %d * %d = %d \n", nbr, i, nbr*i);
    }
    
    return 0;
}

Output:

Enter an integer: 9

 Multiplication table of 9 is: 
 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

 

mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

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