Boiling Water

Boiling Water

Using if and else statements, make a program that prompts the user for the temperature of water in celsius.

Output "The water is boiling" if the temperature is 100 or above. Otherwise output "The water is not boiling".

Answer

#include <iostream>

int main()
{
    std::cout << "What is the temperature of the water (in celsius)? ";

    float temp;
    std::cin >> temp;

    if (temp >= 0)
    {
        std::cout << "The water is frozen.";
    }
    else
    {
        std::cout << "The water is not boiling.";
    }
}
Questions