Skip to content

Instantly share code, notes, and snippets.

@godie007
Created May 17, 2012 22:29
Show Gist options
  • Select an option

  • Save godie007/2721992 to your computer and use it in GitHub Desktop.

Select an option

Save godie007/2721992 to your computer and use it in GitHub Desktop.
import javax.swing.JOptionPane;
public class Ejercicio6 {
public static void main(String[] args) {
int a = Integer.parseInt(JOptionPane.showInputDialog(""));
int b = Integer.parseInt(JOptionPane.showInputDialog(""));
int c = Integer.parseInt(JOptionPane.showInputDialog(""));
System.out.println(metodo(a, b, c));
}
public static int metodo(int a, int b, int c) {
int dato = 0;
if (a > b && a > c) {
dato = a;
} else if (b > a && b >c) {
dato = a;
}else if (c > a && c > b) {
dato = c;
}return dato;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment