C program to multiply two floating point Numbers. - C tutorial

Programming languages or concepts
0
In this C tutorial we learn how to multiple two float number and who to print the result in float. Let's go
 

C program to multiply two floating point Numbers.


#include <stdio.h>
int main() {
    double a, b, product;
    printf("Enter two float numbers: ");
    scanf("%lf %lf", &a, &b);  
    product = a * b;
    printf("Product = %.2lf", product);
    
    return 0;
}

In this program user can put two float number which are stored in variable a & b data type is double
      printf (" Enter two float number: ");
      scanf (" %f %f ",&a, &b);

Then the product of a and b is evaluated and the output stored in result variable.


Recommended:

Post a Comment

0Comments

Post a Comment (0)
close