C Program to print multiplication table of any number.

 #include<stdio.h>




int main()
{
    int num;
    printf("Enter the number you want multiplication table of:\n");
    scanf("%d", &num);

    printf("Multiplication table of %d is as follows:\n", num);

    for (int i = 1; i < 11; i++)
    {
        printf("%d x %d = %d\n", num,i,num*i);
    }
   
    return 0;
}


Enter the number you want multiplication table of: 4 Multiplication table of 4 is as follows: 4 x 1 = 4 4 x 2 = 8 4 x 3 = 12 4 x 4 = 16 4 x 5 = 20 4 x 6 = 24 4 x 7 = 28 4 x 8 = 32 4 x 9 = 36 4 x 10 = 40
Enter the number you want multiplication table of:
67
Multiplication table of 67 is as follows:
67 x 1 = 67
67 x 2 = 134
67 x 3 = 201
67 x 4 = 268
67 x 5 = 335
67 x 6 = 402
67 x 7 = 469
67 x 8 = 536
67 x 9 = 603
67 x 10 = 670

Enter the number you want multiplication table of: 436 Multiplication table of 436 is as follows: 436 x 1 = 436 436 x 2 = 872 436 x 3 = 1308 436 x 4 = 1744 436 x 5 = 2180 436 x 6 = 2616 436 x 7 = 3052 436 x 8 = 3488 436 x 9 = 3924 436 x 10 = 4360


Comments

Post a Comment

Popular posts from this blog

C Program using continue statement

C program of WHILE Loop

NULL Pointer in C.

C Program using DO WHILE loop

C Program using SWITCH statement

New Animated Login or signup page made by HTML, CSS and JavaScript.

C Language Travel Agency Manager Exercise.

STRUCTURE IN C PROGRAMMING.