Question: Write a method called max that takes two integers as input and returns the larger of the two. That is , complete the function public

Write a method called max that takes two integers as input and returns the larger of the two. That is, complete the function public static int max(int a, int b){ so that it returns the larger of a or b using an if statement (hint: lab #2 has a similar question, using Math methods. Your job is to build a method that will perform the same functionality as Math.max)
Ask the user for two integers using a Scanner and report the largest and smallest values using the max method you just built. Consider the following output:
//sample output for problem 13
Enter two integers: 214
Largest is 14
Smallest is 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!