// Single return at end often improves readability. int max(int a, int b) { int maxval; if (a > b) { maxval = a; } else { maxval = b; } return maxval; }//end max