Question #248323

Write a C program which reads values for two floats and outputs their sum, product, and quotient. Include a sensible input prompt and informative output.

Expert's answer

#include <stdio.h>
int main() {
  printf("Enter 2 numbers: ");
  float a, b;
  scanf("%f %f", &a, &b);
  printf("Sum: %f\n", a + b);
  printf("Product: %f\n", a * b);
  printf("Quotient: %f\n", a / b);
  return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS