Multiply two floating point numbers in C

Video 3 of 82023-12-07
Course Progress38%

Code & Notes

Multiply two floating point numbers in C

#include <stdio.h>

int main(void) {
  double a, b, product=0.0; // variable declaration
  printf("Enter two numbers: ");
  scanf("%lf %lf", &a, &b);
  product = a*b; // calculation
  printf("The product of two numbers are: %.2lf\n", product);
  return 0;
}