Q:

Write C program to print multiplication table of a given number

0

Write C program to print multiplication table of a given number

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h>

int main()
{
    int i, num;

    //Reading number
    printf("Enter number to print table: ");
    scanf("%d", &num);

    for(i=1; i<=10; i++)
    {
        //Printing table of number entered by user
        printf("%d x %d = %d\n", num, i, (num*i));
    }

    return 0;
}

Result:

Enter number to print table: 5

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

5 x 9 = 45

5 x 10 = 50

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a C program to print all natural numbers in ... >>
<< Write C program to print ASCII values of all chara...