Programming

C – 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

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.