PROGRAM :
import javax.swing.*;
class SwapSwing
{
public static void main( String [] args)
{
String s,v;
int a,b,c;
s= JOptionPane.showInputDialog("Enter the first number");
a = Integer.parseInt(s);
v= JOptionPane.showInputDialog("Enter the second number");
b = Integer.parseInt(v);
JOptionPane.showMessageDialog("the two number before swapping are :"+a +b);
c=a;
a=b;
b=c;
JOptionPane.showMessageDialog("the two number after swapping are :"+a +b);
}
}
No comments:
Post a Comment