C program to display the multiplication table of input number using function.
#include<stdio.h>
void tab(int);
int main()
{
int n;
printf("Enter any number\n");
scanf("%d", &n);
printf("\nMultiplication Table of %d is:\n", n);
tab(n);
return 0;
}
void tab(int num)
{
int x;
for(x = 1; x <= 10; x++)
{
printf("%d x %d = %d\n", num, x, num*x);
}
}
Output:
You may also like:
No comments:
Post a Comment