netb si and

2
import javax.swing.JOptionPane; import javax.swing.*; public class tres_num { /** * @Autor Dagoberto Sierra */ public static void main(String[] args) { // TODO code application logic here int n1, n2, n3 ; n1 =Integer.parseInt(JOptionPane.showInputDialog(null,"ingrese un 1er numero")); n2 =Integer.parseInt(JOptionPane.showInputDialog(null,"ingrese un 2do numero")); n3 =Integer.parseInt(JOptionPane.showInputDialog(null,"ingrese un 3er numero")); if ((n1>n2)&& (n1>n3)) JOptionPane.showMessageDialog(null, "El numero mayor es el primero "+n1); if ((n2>n1)&& (n2>n3)) JOptionPane.showMessageDialog(null, "El numero mayor es el segundo "+n2); if ((n3>n1 && n3>n2)) JOptionPane.showMessageDialog(null, "El numero mayor es tercero "+n3); } Profesor Dagoberto Sierra Página 1

Upload: dagoberto-sierra

Post on 25-Jul-2015

423 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Netb si and

import javax.swing.JOptionPane;

import javax.swing.*;

public class tres_num {

/**

* @Autor Dagoberto Sierra

*/

public static void main(String[] args) {

// TODO code application logic here

int n1, n2, n3 ;

n1 =Integer.parseInt(JOptionPane.showInputDialog(null,"ingrese un 1er numero"));

n2 =Integer.parseInt(JOptionPane.showInputDialog(null,"ingrese un 2do numero"));

n3 =Integer.parseInt(JOptionPane.showInputDialog(null,"ingrese un 3er numero"));

if ((n1>n2)&& (n1>n3))

JOptionPane.showMessageDialog(null, "El numero mayor es el primero "+n1);

if ((n2>n1)&& (n2>n3))

JOptionPane.showMessageDialog(null, "El numero mayor es el segundo "+n2);

if ((n3>n1 && n3>n2))

JOptionPane.showMessageDialog(null, "El numero mayor es tercero "+n3);

}

}

Profesor Dagoberto Sierra Página 1