Answer to Question #286619 in C for jay

Question #286619

Decimal x Decimal

by CodeChum Admin

Now that we're done with integers, we're moving on to decimals!


Instructions:

  1. Input three decimal numbers in one line separated by spaces, and make sure to store them in different variables.
  2. Multiply the 1st and 2nd decimal numbers, and store the product into a variable.
  3. Then, divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number, then print out its quotient.

Input


1. First decimal number

2. Second decimal number

3. Third decimal number

Output


The first three lines will contain message prompts to input the three decimal numbers.

The last line contains the result in two decimal places.


Enter·the·first·number:·1.53

Enter·the·second·number:·2.25

Enter·the·third·number:·1.23

Result·=·2.80




1
Expert's answer
2022-01-11T11:06:32-0500




#include <stdio.h>
#include <string.h>
#include <ctype.h>




int main(){
	float number1,number2,number3,product,quotient;




	printf("Enter the first number: ");
	scanf("%f",&number1);
	printf("Enter the second number: ");
	scanf("%f",&number2);
	printf("Enter the third number: ");
	scanf("%f",&number3);
	product=number1*number2;
	quotient=product/number3;
	printf("Result = %.2f\n",quotient);




	getchar();
	getchar();
	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