If you need to determine minimum and maximum in C++ from a certain value or variable then you can try it ~~~~~ int max = max({a,b,c}); //here a,b,c are variables or values int min = min({a,b,c}); or int max = max({n1,n2,n3,n4....nn}); //here n1,n2,...nn are variables or values int min = min({n1,n2,n3,n4....nn}); ~~~~~