basics · beginner · ~15 min

Max of three

Use `if/else` to compare values.

Challenge

Implement int max3(int a, int b, int c) returning the largest of the three values.

Starter code

int max3(int a, int b, int c) {
    /* TODO */
    return 0;
}

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