import javax.swing.*;
public class MinOfThree
{
public static void main(String[] args)
{
int num1, num2, num3, min = 0;
num1 = Integer.parseInt (JOptionPane.showInputDialog (null, "Enter a 1st number"));
num2 = Integer.parseInt (JOptionPane.showInputDialog (null, "Enter a second number"));
num3 = Integer.parseInt (JOptionPane.showInputDialog (null, "Enter a third number"));
if (num1 < num2)
if (num1 < num3)
min = num1;
else
min = num3;
else
if (num2 < num3)
min = num2;
else
min = num3;
// System.out.println("Minimum value is: " + min);
JOptionPane.showMessageDialog(null,"The Minimum value is "+ min);
JOptionPane
}
}
Wednesday, 24 January 2018
Related Posts:
throw exception in java import java.io.*; //include Java's standard Input and Output routinesc… Read More
Get input from user in java import java.io.*;import java.util.Scanner;public class GetUserInput {&… Read More
java swing import java.awt.*;import java.awt.event.*;import javax.swing.*;import … Read More
Input example in java import javax.swing.*;public class InputExample{ public static vo… Read More
0 comments: