static float relacion (int a, int b) {
float t=(a-b);
if (t>=0){
System.out.println ("EL RESULTADO ES POSITIVO");
}
else {
System.out.println("EL RESULTADO ES NEGATIVO");
}
return t ;
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int g= Integer.parseInt(JOptionPane.showInputDialog("DIGITE UN NUMERO"));
System.out.println (g);
int h= Integer.parseInt(JOptionPane.showInputDialog("DIGITE UN NUMERO"));
System.out.println (h);
float p=Acerlo.relacion (g,h);
JOptionPane.showMessageDialog(null,p);
}
}
No hay comentarios:
Publicar un comentario