Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public static int findMax ( int val 1 , int val 2 ) { int max; if ( val 1 > val 2 ) {

public static int findMax(int val1, int val2){
int max;
if(val1> val2){
max = val1;
}
else{
max = val2;
}
return max;
}
public static void main(String args[]){
int max1;
int max2;
int max3;
max1= findMax(15,7);
max2= findMax(100,101);
max3= findMax(20,30);
}
Group of answer choices
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions