Arg... Guys can you correct my code?
'coz it gives me a wrong output if i input "3 , 1, 2 or 1, 3, 2 or 3, 2 ,1"
import javax.swing.*;
public class OutputGreatest
{
public static void main(String[] args)
{
int uInput1,uInput2,uInput3;
int maxValue;
uInput1 = Integer.parseInt(JOptionPane.showInputDialog(null,"<1>Input a number : "));
uInput2 = Integer.parseInt(JOptionPane.showInputDialog(null,"<2>Input a number : "));
uInput3 = Integer.parseInt(JOptionPane.showInputDialog(null,"<3>Input a number : "));
maxValue = (uInput1 > uInput2 || uInput1 > uInput3)? +uInput1: +uInput2;
maxValue = (uInput2 > uInput1 || uInput2 > uInput3)? +uInput2: +uInput1;
maxValue = (uInput3 > uInput1 || uInput3 > uInput2)? +uInput3: +uInput2;
JOptionPane.showMessageDialog(null,"Greatest value is: "+maxValue );
System.exit(0);
}
}