Tag Archives: Math

Java min&max

The program asks for three numbers and prints either the biggest or the smallest of them depending which one you choose. BiggestOrSmallestNumber.java: import java.util.Scanner; public class BiggestOrSmallestNumber { public void run() { Scanner numberReader=new Scanner(System.in); Scanner textReader = new Scanner(System.in); int number1, number2, number3; String biggestSmallest; System.out.println(“Enter three numbers:”); number1=numberReader.nextInt(); number2=numberReader.nextInt(); number3=numberReader.nextInt(); System.out.print(“Do you want… Read More »