You are on page 1of 3

Package javaapplication65;

Import javax.swing.JOptionPane;

Public class Main {

Public static void main(String[] args) {

String input= “”;

Int n1,n2,n3;

Input=JOptionPane.showInputDialog(“Enter the first number”);

N1=Integer.parseInt(input);

Input=JOptionPane.showInputDialog(“Enter the second number”);

N2=Integer.parseInt(input);

Input=JOptionPane.showInputDialog(“Enter the third number”);

N3=Integer.parseInt(input);

If (n1==1 && n2==5 && n3==9){

JOptionPane.showMessageDialog(null,” you win”);}

Else if (n1==3 && n2==5 && n3==7){

JOptionPane.showMessageDialog(null,” you win “ );}


Else if (n1==9 && n2==5 && n3==1){

JOptionPane.showMessageDialog(null,” you win “ );}

Else if (n1==7 && n2==5 && n3==3){

JOptionPane.showMessageDialog(null,” you win “ );}

Else if (n1==1 && n2==4 && n3==7){

JOptionPane.showMessageDialog(null,” you win “ );}

Else if (n1==2 && n2==5 && n3==8){

JOptionPane.showMessageDialog(null,” you win “ );}

Else if (n1==3 && n2==6 && n3==9){

JOptionPane.showMessageDialog(null,” you win “ );}

Else if (n1==7 && n2==4 && n3==1){

JOptionPane.showMessageDialog(null,” you win “ );}

Else if (n1==4 && n2==5 && n3==2){

JOptionPane.showMessageDialog(null,” you win “ );}

Else if (n1==9 && n2==6 && n3==3){

JOptionPane.showMessageDialog(null,” you win “ );}

Else {

JOptionPane.showMessageDialog(null,” you lose “ );}

}
}

You might also like