Find the Largest of 3 Numbers using Swings Concept


Find the Largest of 3 Numbers using Swings Concept

import javax.swing.JOptionPane;
import java.io.*;
class large
{
public static void main(String[] args) throws IOException
{

int a=Integer.parseInt(JOptionPane.showInputDialog("enter A value"));
int b=Integer.parseInt(JOptionPane.showInputDialog("enter Bvalue"));
int c=Integer.parseInt(JOptionPane.showInputDialog("enter C value"));
//int a=Integer.parseInt(A);
//int b=Integer.parseInt(B);
if(a>b&&a>c)
{

JOptionPane.showMessageDialog(null,"largest value","message",JOptionPane.INFORMATION_MESSAGE);
System.out.println("largest value:"+a);
}
else if(b>c)
{
JOptionPane.showMessageDialog(null,"largest value","message",JOptionPane.INFORMATION_MESSAGE);
System.out.println("largest value:"+b);
}
else
{
JOptionPane.showMessageDialog(null,"largest value","message",JOptionPane.INFORMATION_MESSAGE);
System.out.println("largest value:"+c);
}
}
}







2 comments

super, excellent, good, nice, very good, superb, outstanding, magnificent, exceptional, marvellous, wonderful, sublime, perfect, eminent, matchless, peerless, supreme, first-class blog

can pls post about finding the largest of 3 numbers without swings concept