# C Program to Multiply two Floating Point Numbers

This post shows how to multiply two floating-point numbers using the C programmingÂ language. So let’s go through the program.

## C Program to Multiply two Floating-Point Numbers

```#include<stdio.h>
int main()
{
float var1, var2, result;
//GETS THE FIRST VALUE FROM THE USER
printf("ENTER VAR1:");
scanf("%%f",&var1);
//GETS THE SECOND VALUE FROM THE USER
printf("ENTER VAR2:");
scanf("%%f",&var2);
//MULTIPLY VAR1 AND VAR2
result=var1*var2;
//DISPLAY THE RESULT UPTO 2 DECIMAL PLACES
printf("RESULT OF TWO VAR1 AND VAR2 is:%%.2f",result);
return 0;
}
```

## Explanation

So this C program deals with the multiplication of two floating-point numbers, in which the user enters the values. These values are stored in the variables var1 and var2, respectively.

```  printf("ENTER VAR1:");
scanf("%%f",&var1);
printf("ENTER VAR2:");
scanf("%%f",&var2);
```

Then the values in var1 and var2 is multipled and the product is stored in the variable named result.

```    //MULTIPLY VAR1 AND VAR2
result=var1*var2;
printf("RESULT OF TWO VAR1 AND VAR2 is:%%.2f",result);
```

We are using %.2lf while displaying the result. This means that the value will be rounded off to only two decimal places.