Kodewick
Start learning →
Basic←→0 / 70

Cold or hot

#014BasicConditions4 min

The weather card shows just one word: below 10 degrees is "cold", 25 and above is "hot", and anything in between is "mild". Write weather_word(temp) to return the word.

Examples
weather_word(5)→'cold'
weather_word(18)→'mild'
weather_word(30)→'hot'
The functionconst char *weather_word(int temp)
main.c
const char *weather_word(int temp) {
    // your code here: below 10 return "cold"; 25 and above return "hot"
    return "mild";
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.