Ask Question
23 March, 23:11

Write the definition of a method printlarger, which has two int parameters and returns nothing. the method prints the larger value of the two parameters to standard output on a single line by itself.

+2
Answers (1)
  1. 24 March, 01:27
    0
    public class ExampleMaxNumber {

    public static void main (String[] args) {

    int a = 11;

    int b = 6;

    int c = maxFunction (a, b);

    System. out. println ("Maximum Value = " + c);

    }

    / * * returns the maximum of two numbers * /

    public static int maxFunction (int n1, int n2) {

    int max;

    if (n1 > n2)

    max = n1;

    else max = n2;

    return max;

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write the definition of a method printlarger, which has two int parameters and returns nothing. the method prints the larger value of the ...” 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