Kodewick
Start learning →
Starter←→0 / 70

Is the bakery open?

#046StarterFunctionsConditions3 min

The bakery opens at 7 and closes at 19. Write is_open(hour): return true if the shop is open at hour (0 to 23), otherwise false. At 7 it's open; at 19 it's already closed.

Examples
is_open(9)→True
is_open(20)→False
The functionbool is_open(int hour)
main.c
#include <stdbool.h>

bool is_open(int hour) {
    bool open = false;
    // your code here: open is true when hour is at least 7 and below 19
    return open;
}
Ctrl + Enter runs too
Result

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