Ask Question

The Math class provides a static method, max, that accepts two int arguments and returns the value of the larger one. Two int variables, population1 and population2, have already been declared and initialized. Write an expression (not a statement!) whose value is the larger of population1 and population2 by calling max.

+2
Answers (1)
  1. 4 April, 09:48
    0
    int result=max (population1, population2);

    printf ("%d", result);

    Explanation:

    in above result variable holds the largest value of two variables population1 and population2. Printf displays that largest value.

    int result=max (population1, population2);

    in above expression, right hand side we are calling max function and on the left hand side we are saving the return value of the function in result variable
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “The Math class provides a static method, max, that accepts two int arguments and returns the value of the larger one. Two int variables, ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers