Kodewick
Start learning →
Starter←→0 / 50

Largest of three

#003Starterif (b > max)3 min

Write largest(a, b, c) to return the biggest of three whole numbers. For example, largest(3, 9, 5) is 9. The numbers may be negative or equal. The starter assumes a is the biggest and keeps it in max.

Examples
largest(3, 9, 5)→9
largest(7, 2, 4)→7
The functionint largest(int a, int b, int c)
main.c
int largest(int a, int b, int c) {
    int max = a;
    // your code here: if b is bigger than max, take b; same for c
    return max;
}
Ctrl + Enter runs too
Result

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