1 import java.util.Scanner; 2 3 public class SubtractionQuiz { 4 public static void main(String[] agrs) { 5 int number1 = (int)(Math.random() * 100); 6 int number2 = (int)(Math.random() * 100); 7 8 if (number1 < number2) { 9 int temp = number1; 10 number1 = number2; 11 number2 = temp; 12 } 13 14 System.out.print("What is " + number1 + " - " + number2 + "?"); 15 Scanner input = new Scanner(System.in); 16 int answer = input.nextInt(); 17 18 if (number1 - number2 == answer) 19 System.out.println("You are correct!"); 20 else 21 System.out.println("You are wrong " + number1 + " - " + number2 + " should be " + (number1 - number2)); 22 23 } 24 }