Write a c program Multiplication table

Write a c program Multiplication table

Program:

#include <stdio.h>
int main()
{
int a, i;
printf(“Enter a number: “);
scanf(“%d”,&a);
for(i=0; i<=5; ++i)
{
printf(“%d * %d = %d \n”, a, i, a*i);
}
return 0;
}
}

Output:

Enter a number: 7
7 * 0 = 0
7 * 1 = 7
7 * 2 = 14
7 * 3 = 21
7 * 4 = 28
7 * 5 = 35

No Comments

Post a Reply