Compare two numbers with symbols

Report a typo

Given two numbers, determine if the first number is greater than, less than, or equal to the second number. Print '>' if the first number is greater than the second, '<' if it is less than the second, or '=' if they are equal.

Sample Input 1:

5
3

Sample Output 1:

>

Sample Input 2:

2
7

Sample Output 2:

<
Write a program in Kotlin
import java.util.Scanner

fun main() {
val scanner = Scanner(System.`in`)

// Read the two numbers
val num1 = scanner.nextInt()
val num2 = scanner.nextInt()

// TODO: Compare the two numbers and print the result
// Use the relational operators (<, >, ==) to compare num1 and num2
// Print '>' if num1 is greater than num2
// Print '<' if num1 is less than num2
// Print '=' if num1 is equal to num2

}

Create a free account to access the full topic