/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package question1a; import java.util.Scanner; /** * * @author crusoe */ public class Question1a { /** * @param args the command line arguments */ public static void main(String[] args) { int a, b, c, d, e, max, min; Scanner keyboard = new Scanner(System.in); System.out.println("Enter five integer numbers"); a = keyboard.nextInt(); b = keyboard.nextInt(); c = keyboard.nextInt(); d = keyboard.nextInt(); e = keyboard.nextInt(); max = min = a; if (b < min) min = b; if (b > max) max = b; if (c < min) min = c; if (c > max) max = c; if (d < min) min = d; if (d > max) max = d; if (e < min) min = e; if (e > max) max = e; System.out.println("The minimum is " + min + " and the maximum is " + max); } }