Program to Multiply Two Floating-Point Numbers - ( C Programs )
Example
#include <stdio.h>
int main() {
float num1, num2, product;
printf("Enter two numbers: ");
scanf("%f %f", &num1, &num2);
product = num1 * num2;
printf("Product: %f", product);
return 0;
}
Output
Enter two numbers: 2.5 3.5
Product: 8.750000
Explanation
This C program reads two floating-point numbers from the user and multiplies them. The product is then displayed on the screen.
Use
This program can be used to multiply two floating-point numbers in a C program. It is useful in mathematical calculations where multiplication of two values is required.
Summary
- This program multiplies two floating-point numbers.
- The user inputs the two numbers.
- The product is calculated.
- The product is displayed on the screen.