In c++, for 3 variables(a,b,c)-
int mx = max({a,b,c}); int mn = min({a,b,c});
for n variables(a1,a2,a3 ....n)-
int mx = max({a1,a2,a3 ....n}); int mn = min({a1,a2,a3 ....n});
Using this syntex we can easily find the max and min variable.
Find the maximum and minimum of three or more variables
In c++, for 3 variables(a,b,c)-
int mx = max({a,b,c}); int mn = min({a,b,c});
for n variables(a1,a2,a3 ....n)-
int mx = max({a1,a2,a3 ....n}); int mn = min({a1,a2,a3 ....n});
Using this syntex we can easily find the max and min variable.