How do I make it so that if both numbers are entered between 10 and 20 it will print false?
The assignment: Ask the user to enter 2 ints. Output "true" if one of them is in the range 10 - 20 inclusive, but not both. Otherwise output "false"
12 99 → true
21 20 → true
8 99 → false
15 17 → false
import java.util.Scanner; public class Practice { public static void main(String[] args) { //get user input Scanner user_input = new Scanner(System.in); System.out.print("Enter a number: " ); int firstNum = user_input.nextInt(); Scanner other_input = new Scanner(System.in); System.out.print("Enter another number: " ); int secondNum = other_input.nextInt(); //if else statement if (firstNum >= 10 && firstNum <=20 && secondNum >= 10 && secondNum <= 20) { System.out.println("true"); } else System.out.println("false"); } }