Back In the print window choose "Save as PDF" as the destination
NOTE.CS

Largest of Three Numbers

1 topic · 28 Nov 2026
1

Largest of Three Numbers

Problem Solving
Solution 1: if - else if · C++
if(a >= b && a >= c)
    cout << a;
else if(b >= a && b >= c)
    cout << b;
else
    cout << c;
Solution 2: Nested max() · C++
cout << max(a, max(b, c));
Solution 3: max() with initializer list (shortest) · C++
cout << max({a, b, c});

Note: max() needs #include <algorithm>.