Program :
import javax.swing.*;
class AddSwing
{
public static void main (String [] args)
{
String s,v ;
int a,b,c=0;
s = JOptionPane.showInputDialog("Enter the first number");
a= Integer.parseInt(s);
v = JOptionPane.showInputDialog("Enter the Second number");
b= Integer.parseInt(v);
c = a+b;
JOptionPane.showMessageDialog("Result is :"+c);
}
}
No comments:
Post a Comment