Answer to Question #248323 in C for Samzzy

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.
1
Expert's answer
2021-10-08T04:35:04-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS