"Untitled" By gando (https://pastebin.com/u/gando) URL: https://pastebin.com/azr0kAjA Created on: Thursday 19th of January 2012 05:52:37 PM CDT Retrieved on: Saturday 31 of October 2020 07:57:12 AM UTC /** * @author gando **/ import java.util.Scanner; public class mathMaxExample { public static void main(String[] args) { Scanner in = new Scanner(System.in); int compareOne, compareTwo, largerNumber; String position; System.out.print("Enter a number to be compared. $> "); compareOne = Integer.parseInt(in.nextLine()); System.out.print("Enter a second number to be compared. $> "); compareTwo = Integer.parseInt(in.nextLine()); largerNumber = Math.max(compareOne, compareTwo); position = compareOne == largerNumber ? "first." : "second."; System.out.println("You entered the numbers " + compareOne + " and " + compareTwo + ". " + largerNumber + " was the larger number, and you entered it " + position); } }