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);
}
}
Showing posts with label Java program for addition of two numbers. Show all posts
Showing posts with label Java program for addition of two numbers. Show all posts
Java program for condition check within two numbers
Subscribe to:
Posts (Atom)