basics · beginner · ~15 min

Program status code

Model exit-code conventions.

Challenge

main returns 0 for success, non-zero for failure. Implement int program_status(int errors) returning 0 when errors is 0, otherwise 1.

Starter code

int program_status(int errors) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.