import javax.swing.JOptionPane;
class Addition1
{
public static void main(String args[])
{
String result="";
String fN;
String sN;
int n1,n2;
fN=JOptionPane.showInputDialog("Enter the first number");
sN=JOptionPane.showInputDialog("Enter the second number");
n1=Integer.parseInt(fN);
n2=Integer.parseInt(sN);
if(n1==n2)
result=result+n1+"=="+n2;
if(n1>=n2)
result=result+"\n"+n1+">="+n2;
if(n1<=n2)
result=result+"\n"+n1+"<="+n2;
if(n1!=n2)
result=result+"\n"+n1+"!="+n2;
if(n1
result=result+"\n"+n1+"<"+n2;
if(n1>n2)
result=result+"\n"+n1+">"+n2;
JOptionPane.showMessageDialog(null,result);
}
}
Java program for condition check within two numbers
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment