Programming Examples
C program to create function to display the multiplication table of the number
Write a function to display the multiplication table of the number.
Solution
#include<stdio.h>
void printTable(int);
int main()
{
int num;
printf("Enter any number : ");
scanf("%d",&num);
printTable(num);
return 0;
}
void printTable(int n)
{
int a;
for(a=1;a<=10;a++)
{
printf("%d\t",a*n);
}
}
Output
Enter any number : 7
7 14 21 28 35 42 49 56 63 70