Kodewick
Start learning →
Starter←→0 / 70

Take an umbrella?

#012StarterConditions2 min

Before going out, check the weather: if the chance of rain (0 to 100) is 50 or more, take an umbrella. Write need_umbrella(rain_chance) to return true if you need one and false if not.

Examples
need_umbrella(80)→True
need_umbrella(10)→False
The functionbool need_umbrella(int rain_chance)
main.c
#include <stdbool.h>

bool need_umbrella(int rain_chance) {
    // your code here: if the chance is 50 or more, return true
    return false;
}
Ctrl + Enter runs too
Result

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