basics · beginner · ~15 min
Group switch cases that share a result.
Implement int days_in_month(int m) returning the number of days in month m (1-12) for a non-leap year. Return 0 for an invalid month.
int days_in_month(int m) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.