You are given a program that compares two integers `numberA` and `numberB`. Your task is to fill the blanks in the code to print out whichever number is greater. Use an 'if' expression to compare the two numbers and string templates to display the result. Make sure your solution uses relational operators for comparison.
If expression
Comparing two integers and displaying the greater one
Report a typo
Fill in the gaps with the relevant elements
fun main() {
val numberA = 10
val numberB = 20
val result = (numberA > numberB) "Number A ($numberA) is greater than Number B ($numberB)"
"Number B ($numberB) is greater than Number A ($numberA)"
(result)
} ___
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.