Module: Java. Conditional operator


Problem

3/17

Largest of two numbers - OPTION 2

Theory Click to read/hide

Consider the second solution to the problem of finding the maximum of two numbers.
In the second program, we will first write the maximum value to an additional variable (give it the name Max)

Problem

1. Run the program
2. Analyze the result and make sure that the variable Max gets the value of the variable A if A> B and Max = B if B> A
3. Answer the question: What block will be executed if A = B?