Multiplication in C

In the below program is the multiplication of two numbers, the user is need to enter two numbers and the input is fetched using the pre-defined function scanf() and stored in the variables a and b. Then, the variables a and b are multiplied and the result is stored in the variable c.

Here a, b and c are declared as integer datatype. If you want to multiple the decimal values, you have to declared the variables as float datatype.

Below is the multiplication of two numbers program in C:

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("\n\n\t\t\tMULTIPLICATION\n\nEnter the two number: ");
scanf("%d%d",&a,&b);
c=a*b;
printf("\nProduct= %d",c);
getch();
}

 

Leave a Reply