C Program to Multiply Two Floating-Point Numbers
In this example, we will learn to take two numbers as user input , then multiply them and print the result on screen.
Remainder :
To understand this example, you should have the knowledge of the following C programming topics:
Program to Multiply Two Numbers
#include <stdio.h>
int main() {
int num1, num2, product;
printf("Enter two number : ");
scanf("%d %d", &num1, &num2);
product = num1 * num2;
printf("The product of %d and %d is %d", num1, num2, product);
return 0;
}
Output
Enter two number : 23 12
The product of 23 and 12 is 276
Working of the above program
- First we declare three integer variables num1, num2 and sum, in which num1, num2 used to store integers and product to store the sum of both integers .
int num1, num2, product;
printf("Enter two number : ");
scanf("%d %d", &num1, &num2);
product = num1 * num2;
printf("The product of %d and %d is %d", num1, num2, product);