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

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad