Maximum of four integer numbers

Write a function that returns the maximum of four given integer numbers
@a@, @b@, @c@ and @d@.

Interface

+-------:+:--------------------------------------------------------+
| C++,C  |     int max4(int a, int b, int c, int d);               |
+--------+---------------------------------------------------------+
| Java   |     public static int max4(int a, int b, int c, int d); |
+--------+---------------------------------------------------------+
| Python |     max4(a, b, c, d)  # returns int                     |
+--------+---------------------------------------------------------+
|        |     max4(a: int, b: int, c: int, d: int) -> int         |
+--------+---------------------------------------------------------+

Observation

You only need to submit the required procedure; your main program will
be ignored.

Hint

Using function @max2(a, b)@ of
exercise problem://problemsjutge.org:problems/p1/jpetit/maxim-funcio.pbm
could be useful.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T11:44:39.037Z

© Jutge.org, 2006–2026.
https://jutge.org
