Question: How does using findMax ( ) improve the code? public static int findMax ( int val 1 , int val 2 ) { int max;
How does using findMax improve the code?
public static int findMaxint val int val
int max;
if val val
max val;
else
maxval
return max;
public static void mainString args
int max;
int max;
int max;
maxfindMax;
maxfindMax;
maxfindMax;
Using findMax makes main run faster
Using findMax decreases redundant code
Using findMax reduces the number of variables
Using findMax does not improve the code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
