“Multiplication Table Function C Programming” is a C program related to the use of Functions in C Programming. The following figure will show the output and source code of Multiplication table function.
The source code of C program to print table by using a function is as follows:
/* Write a C program to use a function void table(int n) that receives one number and prints its multipication table on screen. */ void table(int n); /*function prototype or declaration*/ #include<stdio.h> int main() { int num1,c; /* Enter one number in main() */ printf("Enter a number to print Table="); scanf("%d", &num1); /* call the function by sending one number */ table(num1); return 0; } /* wrtite down function definition */ void table(int n) { int c; printf("Multiplication Table of %d is:",n); for(c=1;c<=10;c++) printf("\n %d * %d = %d",n,c,n*c); }