Implement a simple program in Kotlin that finds the maximum of two numbers 'a' and 'b'. Use decision-making control structures to evaluate the larger number. Assign this larger value to the variable 'max'. Display a message to the console, using string templates, that indicates the maximum value between 'a' and 'b'. Fill the blanks in the code to accomplish this task.
If expression
Finding the maximum of two numbers
Report a typo
Fill in the gaps with the relevant elements
val a = 5
val b = 3
val max: Int
(a > b) {
max = a
} {
max = b
}
println("The maximum between $a and $b is $max") ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.