You have two integers: 10 and 5. Your task is to create a Kotlin program that calculates and prints the sum and difference of these two numbers. The program should print output in the format: 'The sum is X' and 'The difference is Y'. Please reorder the lines of the existing script to solve this task."
Arithmetic operations
Calculating the sum and difference of two integers
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
println("The difference is $difference")
val difference = numberOne - numberTwo
}
val numberOne = 10
fun main() {
val numberTwo = 5
println("The sum is $sum")
val sum = numberOne + numberTwo
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.