Find the maximum and minimum of three or more variables

Revision en2, by L0K11, 2023-03-26 18:47:16

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.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English L0K11 2023-03-26 18:47:16 4
en1 English L0K11 2023-03-26 18:45:58 310 Initial revision (published)