Nelianjackhx Nelianjackhx
  • 07-11-2016
  • Computers and Technology
contestada

Write the definition of a method min that has two int parameters and returns the smaller.

Respuesta :

kingburrito
kingburrito kingburrito
  • 07-11-2016
public class ExampleMinNumber {
     public static void main(String[] args) {
          
int a = 11;
         
int b = 6;
          int c = minFunction(a, b);
     System.out.println("Minimum Value = " + c);
}

/** returns the minimum of two numbers */
public static int minFunction(int n1, int n2) {
    
int min;
    
if (n1 > n2)
       
min = n2;
    else 
       min = n1;
  return min;
   }
}
java 8.0
Answer Link

Otras preguntas

Which of the following is a pluton?
solve the social problem​
ASAP 50 POINTS Which sentences contain dependent clauses? Select two options. Joaquín showed me how to throw a curveball. Quinton studied in the library for his
What is the domain of the function f(x) = √(x+3)²?
I need the answer for number 8
Solve for t in this equation and show steps please d = vt + 1/2(a)(t^2)
Solve each triangle – find any missing side and angle measures. Round answers to the nearest tenth.
Which is the safest way to view a solar eclipse? with sunglasses with a telescope with your buddy with a projector
Can I Plss get some help on this
Help with exercise The number of calories in a 1.5-ounce chocolate bar is 225. Suppose that the distribution of calories is normally distributed with the stand