C Programming

C Program to Display Multiplication Table of Entered Numbers

Write a c program to take input a number from user and display the multiplication table

C Code

#include <stdio.h>
#include <conio.h>
#include <math.h>
void main()
{

int number, i;

printf("Enter number : ");
scanf("%d",&number);

for(i = 1; i<=10; i++)
printf("n %d X %d = %d", number, i, number*i);

getch();
}

Output

More experiment with multiplication table on c programming…    if we change the length of I up to 20 then that will print 20 times, i.e 

for(i = 1; i<=20; i++) printf("..............................................");

C Code

#include <stdio.h>
#include <conio.h>
#include <math.h>
void main()
{

  int number, i;

  printf("Enter number : ");
  scanf("%d",&number);

  for(i = 1; i<=20; i++)
    printf("n %d X %d = %d", number, i, number*i);

  getch();
}
Output

Related Articles

Back to top button

Adblock Detected

Please turn off your Adblocker to view your content.