V 4 r 3 / 3
where r is the radius of the sphere. Declare 3.14159265 . Your program should declare the variables as doubles
and read in the input value using scanf. Implement r3 as r*r*r.
E. Write a program using the following formula to convert a temperature reading in degrees Fahrenheit to degrees
Celsius:
C (5 / 9)*( F 32)
Where F represents the variable for the Fahrenheit and C represents that variable of the calculated Celsius conversion.
Your program should allow the user to input temperature values in Fahrenheit.
If you enter the formula exactly as above, you will get 0.000000 as the answer, no matter what value you enter.
Identify what the problem is, and correct the problem.
Test your program with the following inputs in Fahrenheit: 212, 100, 32, 0, and -40.
F. Repeat program A above, but using the pow library function to calculate r3. You will need to include the math.h
header file. Check that you get the same answer as before.
G. In a right-angled triangle, the length of the hypotenuse is given by Pythagoras formula:
c a 2 b2
Write a program to enter a and b using scanf, and to display c. All variables should be declared as doubles.
Use the sqrt library function to work out the square root. As a check, entering 12 and 5 should give 13.000000.
If you have not finished the exercises, upload your summary and
then you should work on them in your own time, before the next lab session.