1041. Greatest of Three Numbers
Given three real numbers a, b, and c (each may be positive, negative, integer, or decimal up to 6 places), return the greatest among them.
Example 1:
Input: a = 1, b = 3, c = 5Â Â
Output: 5Â Â
Explanation: 5 is greater than both 1 and 3.
Example 2:
Input: a = 1.123, b = 1.124, c = 1.125Â Â
Output: 1.125Â Â
Explanation: 1.125 is the greatest among the three decimal numbers.
Now Your Turn!
Pick the correct output for the given inputInput: a = -10.999999, b = -5.5, c = -1.000001Â Â
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- -109 <= a, b, c <= 109
- Precision up to 6 decimal places