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
I have tried many times to find a gaming setup for $4k. I have tried many websites but they are not working for my liking. Any o
Vikentia [17]
I would try going to pcpartpicker.com and build your pc from there, and after you’ve done that take your remaining budget to find whatever else you need for your setup
8 0
2 years ago
What is the output for the following program?
Lelu [443]

Answer:

Output:

15

20

25

Explanation:

In first iteration value of num is 10. Condition is checked 10 is less than 21 so value of num is incremented by 5 and value 15 is printed than again condition is checked 15<21 so value of num is incremented again and 20 is printed. Again condition is checked 20<21. So 25 is printed. Then 4th time when condition is checked vakue of num is 25 and while loop condition becomes false because 25 is not less than 21 and program is terminated here.

6 0
2 years ago
Which of the following is NOT an example of written communication?
Veronika [31]

Answer:A conversation between co-workers

Explanation:

4 0
2 years ago
What special enterprise VPN supported by Cisco devices creates VPN tunnels between branch locations as needed rather than requir
castortr0y [4]

Answer:

Dynamic Multipoint VPN

Explanation:

4 0
2 years ago
You are planning to install Windows 10 on a computer in a dual-boot configuration. The computer already has Windows 8 installed.
aniked [119]

Answer:

Shrink the primary partition and create a simple volume for Windows 10.

Explanation:

The EFI’s partition space, after it is shrunk, will not be enough to install your Windows 10 since by default; it can only hold a maximum space of about 250MB to 500MB. Some windows versions call this partition EFI while others refer to it as system reserved. Windows uses EFI partition to hold on to essential components that make your PC boot like boot loaders, system utilities, and a few more.

The answer is B.

When you shrink your volume, whether it is local disk C or a primary partition with plenty of free space, it will create unallocated space. Right click on the unallocated space and create a New Simple Volume that will let you format your partition, assign a drive letter, and install your Windows 10 Operating System.

5 0
2 years ago
Read 2 more answers
Other questions:
  • The combination of two or more technologies or data feeds into a single, integrated tool is referred to as a _____.
    7·1 answer
  • The internet connects millions of computers connected through millions of ____ worldwide.
    9·1 answer
  • Assume that input file references a Scanner object that was used to open a file. Which of the following while loops shows the co
    6·1 answer
  • Explain motherboard in detail
    14·2 answers
  • Hi there! I just started my beginner computer science class and I was wondering if anyone wants to help with an assignment i'm h
    15·1 answer
  • What is the cpu used for
    6·1 answer
  • Is(are) input value(s) to use with a program to test the accuracy of the output.
    5·2 answers
  • Who is he can anyone help me​
    14·2 answers
  • 8.3 code practice edhesive PLEASE HELP AND HURRY
    9·1 answer
  • What are the routes through with Virus transmitted into computer<br>system?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!