1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
spin [16.1K]
2 years ago
13

Write a method called min that takes three integers as parameters and returns the smallest of the three values, such that a call

of min(3, -2, 7) would return -2, and a call of min(19, 27, 6) would return 6. Use Math.min to write your solution.
Computers and Technology
1 answer:
Debora [2.8K]2 years ago
7 0

Answer:

public class Main

{

public static void main(String[] args) {

 System.out.println(min(3, -2, 7));

}

public static int min(int n1, int n2, int n3){

    int smallest = Math.min(Math.min(n1, n2), n3);

    return smallest;

}

}

Explanation:

*The code is in Java.

Create a method named min that takes three parameters, n1, n2, and n3

Inside the method:

Call the method Math.min() to find the smallest among n1 and n2. Then, pass the result of this method to Math.min() again with n3 to find the min among three of them and return it. Note that Math.min() returns the smallest number among two parameters.

In the main:

Call the method with parameters given in the example and print the result

You might be interested in
How many times is the body of the loop executed?
Flura [38]

Answer:

The loop will run 5 times.

3 0
2 years ago
Digital manufacturing has impacted our world today! List a reasons why.
Maru [420]
Because we can get manufacturing faster than usual
6 0
3 years ago
Robert's got a quick hand
Alina [70]
verry
good
song
love
it
6 0
2 years ago
Read 2 more answers
computer hardware without software is useless while computer software without hardware is meaningless. explain what do you under
Rainbow [258]

Answer:

That the software is useless

Explanation:

6 0
3 years ago
What are the consequences of digital footprint ?
tekilochka [14]

Answer:

The digital footprint that is left behind can have repercussions in all areas of your teen's life, potentially resulting in missed job opportunities, public sharing of personal information, ruined relationships — or, in what is likely more relevant to them right now: Their parents finding out what they've been up to

Explanation:

8 0
2 years ago
Other questions:
  • A ____ document identifies the purpose of the program being developed, the application title, the procedures to be followed when
    11·1 answer
  • The "origin" of the cartesian plane in math is the point where x and y are both zero. Given a variable, origin of type Point-- a
    5·1 answer
  • "Consider yourself driving with 60 miles/hour in a city that has only grid like streets, and your GPS is broken.The specificatio
    12·1 answer
  • ON QUIZ PLEASE HELP
    13·1 answer
  • Does access provide email communication
    13·1 answer
  • Are you allowed to copy and paste answers on brainy to give answers to other people?
    5·2 answers
  • Once the CPU has fetched the data requested, what are the next steps in the process?
    15·1 answer
  • There are types of templates​
    5·1 answer
  • There are many best practices for digital recordings. Select the three best practices from the list below. select the best micro
    14·1 answer
  • Add my sna-p dkarpik58?...
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!