/home/caleb/NetBeansProjects/ADSV Java/lab9_CalebFontenot/src/main/java/com/calebfontenot/lab9_calebfontenot/MinimumOf4DeMorgan.java
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.calebfontenot.lab9_calebfontenot;

import java.util.Scanner;

/**
 *
 * @author ASDV2
 */
public class MinimumOf4DeMorgan {

    public static void main(String[] args)
    {
        Scanner scan = new Scanner(System.in);
        while (true) {
            System.out.print("Please enter 4 numbers to find the minimum of the 4: ");
            System.out.println("");
            int _1 = scan.nextInt();
            int _2 = scan.nextInt();
            int _3 = scan.nextInt();
            int _4 = scan.nextInt();

            if (!(_1 > _4 || _1 > _3 || _1 > _2)) { // Is 1 the minimum?
                System.out.println("minimum= " + _1);
            } else if (!(_2 > _4 || _2 > _3 || _2 > _1)) { // Is 2 the minimum?
                System.out.println("minimum= " + _2);
            } else if (!(_3 > _4 || _3 > _2 || _3 > _1)) { // Is 3 the minimum?
                System.out.println("minimum= " + _3);
            } else { // All other conditions failed, _4 must be the minimum
                System.out.println("minimum= " + _4);
            }
            scan.next();
        }
    }
}