Write a menu driven C program (not java or python) with the following choice of submenu items: Enter 1 to convert from Celsius to Fahrenheit Enter 2 to convert from Fahrenheit to Celsius Select 1 or 2: Use a function Celsius which returns Celsius equivalent of a Fahrenheit temperature. C = (5/9)*(F-32) Use a function Fahrenheit which returns Fahrenheit equivalent of a Celsius temperature. F = (9/5)*C + 32 Use the functions above to write a program which converts from Celsius to Fahrenheit or from Fahrenheit to Celsius and displays the result. Your program should repeat as long as the user enters 1 or 2 as the choice. Sample run 1: Enter 1 to convert from Celsius to Fahrenheit Enter 2 to convert from Fahrenheit to Celsius Select 1 or 2: 1 Enter temperature in Celsius: 5 5.00 Celsius = 41.00 Fahrenheit Enter 1 to convert from Celsius to Fahrenheit Enter 2 to convert from Fahrenheit to Celsius Select 1 or 2: 2 Enter temperature in Fahrenheit: 33 33.00 Fahrenheit = 0.56 Celsius Enter 1 to convert from Celsius to Fahrenheit Enter 2 to convert from Fahrenheit to Celsius Select 1 or 2: -1 STOP! Sample run 2: Enter 1 to convert from Celsius to Fahrenheit Enter 2 to convert from Fahrenheit to Celsius Select 1 or 2: 1 Enter temperature in Celsius: 1 1.00 Celsius = 33.80 Fahrenheit Enter 1 to convert from Celsius to Fahrenheit Enter 2 to convert from Fahrenheit to Celsius Select 1 or 2: 1 Enter temperature in Celsius: -2.5 -2.50 Celsius = 27.50 Fahrenheit Enter 1 to convert from Celsius to Fahrenheit Enter 2 to convert from Fahrenheit to Celsius Select 1 or 2: 2 Enter temperature in Fahrenheit: 0.4 0.40 Fahrenheit = -17.56 Celsius Enter 1 to convert from Celsius to Fahrenheit Enter 2 to convert from Fahrenheit to Celsius Select 1 or 2: 3 STOP!
Write a menu driven C program (not java or python) with the following choice of submenu items:
Enter 1 to convert from Celsius to Fahrenheit
Enter 2 to convert from Fahrenheit to Celsius
Select 1 or 2:
Use a function Celsius which returns Celsius equivalent of a Fahrenheit temperature.
C = (5/9)*(F-32)
Use a function Fahrenheit which returns Fahrenheit equivalent of a Celsius temperature.
F = (9/5)*C + 32
Use the functions above to write a program which converts from Celsius to Fahrenheit or from
Fahrenheit to Celsius and displays the result. Your program should repeat as long as the user enters 1 or 2 as the choice.
Sample run 1:
Enter 1 to convert from Celsius to Fahrenheit
Enter 2 to convert from Fahrenheit to Celsius
Select 1 or 2: 1
Enter temperature in Celsius: 5
5.00 Celsius = 41.00 Fahrenheit
Enter 1 to convert from Celsius to Fahrenheit
Enter 2 to convert from Fahrenheit to Celsius
Select 1 or 2: 2
Enter temperature in Fahrenheit: 33
33.00 Fahrenheit = 0.56 Celsius
Enter 1 to convert from Celsius to Fahrenheit
Enter 2 to convert from Fahrenheit to Celsius
Select 1 or 2: -1
STOP!
Sample run 2:
Enter 1 to convert from Celsius to Fahrenheit
Enter 2 to convert from Fahrenheit to Celsius
Select 1 or 2: 1
Enter temperature in Celsius: 1
1.00 Celsius = 33.80 Fahrenheit
Enter 1 to convert from Celsius to Fahrenheit
Enter 2 to convert from Fahrenheit to Celsius
Select 1 or 2: 1
Enter temperature in Celsius: -2.5
-2.50 Celsius = 27.50 Fahrenheit
Enter 1 to convert from Celsius to Fahrenheit
Enter 2 to convert from Fahrenheit to Celsius
Select 1 or 2: 2
Enter temperature in Fahrenheit: 0.4
0.40 Fahrenheit = -17.56 Celsius
Enter 1 to convert from Celsius to Fahrenheit
Enter 2 to convert from Fahrenheit to Celsius
Select 1 or 2: 3
STOP!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 5 images