January 5, 2014 Matthew Maennche C++, Learn To Code 10636, C++ 1 LANGUAGE: C++ CHALLENGE: Given the integer variables x and y , write a fragment of code that assigns the larger of x and y to another integer variable max. SOLUTION: if(x > y){ max = x; }else{ max = y; }
also works
max = x>y?x:y;