basics · beginner · ~15 min
Produce a function the compiler accepts and links.
Write code that compiles cleanly: implement int max2(int a, int b) returning the larger value.
int max2(int a, int b) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.