Kodewick
Start learning →
Basic←→0 / 70

Walk the dog

#015BasicConditions4 min

The dog wants to go out. If the temperature is between 5 and 30 degrees (5 and 30 included) and it is not raining, it is a good day for a walk. Write good_walk_day(temp, raining) to return true on a good day and false otherwise.

Examples
good_walk_day(20, false)→True
good_walk_day(20, true)→False
The functionbool good_walk_day(int temp, bool raining)
main.c
#include <stdbool.h>

bool good_walk_day(int temp, bool raining) {
    // your code here: if temp is between 5 and 30 and it is not raining, return true
    return false;
}
Ctrl + Enter runs too
Result

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