195k views
5 votes
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.

User Synthresin
by
5.3k points

1 Answer

1 vote

Answer:

int result=max(population1,population2);

printf("%d",result);

Step-by-step 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

User Jeffgabhart
by
5.1k points