Kodewick
Start learning →
Starter←→0 / 70

Dance partners

#036StarterFunctionsConditions2 min

Dance class works in pairs. Write all_paired(people): if the number of people is even, everyone has a partner, so return true; if it is odd, someone is left out, so return false. 0 people counts as true.

Examples
all_paired(6)→True
all_paired(7)→False
The functionbool all_paired(int people)
main.c
#include <stdbool.h>

bool all_paired(int people) {
    // your code here: if the number is even, return true
    return false;
}
Ctrl + Enter runs too
Result

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