View All C Programs

 Previews Example  View All C Programs Next Example 

Program to print the table in c

User to enter an integer and this program will generate the multiplication table upto 10.
/* C program to find multiplication table up to 10. */
#include <stdio.h>
#include <conio.h>
 main()
{
    int n, i;
    printf("Enter an integer to find multiplication table: ");
    scanf("%d",&n);
    for(i=1;i<=10;++i)
    {
        printf("%d * %d = %d\n", n, i, n*i);
    }
    getch();
}
Result
Enter an integer to find multiplication table: 2
2 * 1 = 2
2 * 2 = 4
2 * 3 = 6
2 * 4 = 8
2 * 5 = 10
2 * 6 = 12
2 * 7 = 14
2 * 8 = 16
2 * 9 = 18
2 * 10 = 20