Comparing sums

Report a typo

Write a function called isGreater() that takes four integer numbers and returns true if a sum of the first two arguments is greater than a sum of the third and fourth argument. Otherwise, return false.

Use the provided code template.

Sample Input 1:

1
2
3
4

Sample Output 1:

false

Sample Input 2:

3
4
1
2

Sample Output 2:

true

Sample Input 3:

2
3
4
1

Sample Output 3:

false
Write a program in Kotlin
// write your function here

fun main() {
val number1 = readLine()!!.toInt()
val number2 = readLine()!!.toInt()
val number3 = readLine()!!.toInt()
val number4 = readLine()!!.toInt()

println(isGreater(number1, number2, number3, number4))
}
___

Create a free account to access the full topic