समस्या
Return the largest of three integers. Practice comparisons with if statements; don't use a built-in max function.
Implement largest_of_three(a, b, c).
Input
a: The first number. b: The second number. c: The third number.
Output
Return the largest value.
सीमाएँ
-1,000,000,000 ≤ a, b, c ≤ 1,000,000,000
उदाहरण
उदाहरण 1
इनपुट:
a = 3
b = 9
c = 4
अपेक्षित आउटपुट:
expected = 9
इनपुट:
long long a = 3;
long long b = 9;
long long c = 4;
अपेक्षित आउटपुट:
long long expected = 9;
इनपुट:
long a = 3;
long b = 9;
long c = 4;
अपेक्षित आउटपुट:
long expected = 9;
व्याख्या
9 is greater than both 3 and 4.
उदाहरण 2
इनपुट:
a = -5
b = -2
c = -2
अपेक्षित आउटपुट:
expected = -2
इनपुट:
long long a = -5;
long long b = -2;
long long c = -2;
अपेक्षित आउटपुट:
long long expected = -2;
इनपुट:
long a = -5;
long b = -2;
long c = -2;
अपेक्षित आउटपुट:
long expected = -2;
व्याख्या
-2 appears twice and is the largest value.
संदर्भ
यह चुनौती CodeUtility के लिए अनुकूलित की गई है। ऊपर दिए गए स्टेटमेंट और सीमाओं का पालन करें।