Question: C language Write a program that reads the temperature and unit from the user and prints a message indicating if it's hot, cool or cold.
Write a program that reads the temperature and unit from the user and prints a message indicating if it's hot, cool or cold. The user may enter the temperature either in Fahrenheit or in Celsius. Below are the intervals. Use nested if-else statements in your solution. After reading the input, write one compound if-statement that checks if the input is invalid. If it's invalid. terminate the program immediately using the exit(1); function call (just write exit(1); in your code). You may need to include stdlib.h at the top of the code for this function to work. Below are sample outputs. Enter unit (F1,C2):1 Enter temporature: 70 The temperature is cooll
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
