Problem Statement
In this program we will code a basic program to multiply two floating numbers in C programming language.
We can do this with the help of
- Predefined C function – printf()
Code
#include<stdio.h>
int main()
{
float a,b,c;
printf("Enter first number : ");
scanf("%f", &a);
printf("Enter second number : ");
scanf("%f", &b);
c = a*b;
printf("Product is : %f",c);
return 0;
}
Output
Enter first number : 54.4
Enter second number : 23.6
Product is : 1283.840088
Explanation
To multiply two numbers, (after taking both numbers as input) we simple use * operator.