Notification texts go here Contact Us Click here

Using C program to print multiplication table .

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

 


  Program to print multiplication table using while loop. 

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

OUTPUT :

  Enter the value of n: 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   Enter the value of n: 18 18 x 1 = 18 18 x 2 = 36 18 x 3 = 54 18 x 4 = 72 18 x 5 = 90 18 x 6 = 108 18 x 7 = 126 18 x 8 = 144 18 x 9 = 162 18 x 10 = 180  

  Program to print the multiplication table using while loop  in reverse order .


#include<stdio.h>
int main()
{   int i=10,n;                            // In case you print table 20 while using int i = 20,n;
    printf("Enter the value of n: ");     //Enter the number multiplication table want to print 
    scanf("%d",&n);
    while(i)
    {
        printf("%d x %d = %d\n",n,i,n*i);
        i--;
    }
    return 0;
}
 
 

OUTPUT :

  Enter the value of n: 5 5 x 10 = 50 5 x 9 = 45 5 x 8 = 40 5 x 7 = 35 5 x 6 = 30 5 x 5 = 25 5 x 4 = 20 5 x 3 = 15 5 x 2 = 10 5 x 1 = 5   Enter the value of n: 15 15 x 10 = 150 15 x 9 = 135 15 x 8 = 120 15 x 7 = 105 15 x 6 = 90 15 x 5 = 75 15 x 4 = 60 15 x 3 = 45 15 x 2 = 30 15 x 1 = 15  

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.