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;
}
Comments
Leave a comment