Determining range of an integer: low, mid or high

Report a typo

Given an input integer 'n', your program must output a string. If 'n' is less than 5, output 'LOW'. If 'n' is exactly 5, output 'MID'. If 'n' is greater than 5, output 'HIGH'.

Sample Input 1:

3

Sample Output 1:

LOW

Sample Input 2:

5

Sample Output 2:

MID
Write a program in Java 17
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
// Create a Scanner object to read the user input
Scanner scanner = new Scanner(System.in);

// Read an integer from the user
int n = scanner.nextInt();

// YOUR CODE HERE: If 'n' is less than 5, output 'LOW'. If 'n' is exactly 5, output 'MID'. If 'n' is greater than 5, output 'HIGH'.

}
}

Create a free account to access the full topic