Ask Question
29 September, 00:21

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

+3
Answers (1)
  1. 29 September, 03:13
    0
    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
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write the definition of a method min that has two int parameters and returns the smaller. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers