Skip to content

Instantly share code, notes, and snippets.

@gmfc
Created May 20, 2013 13:00
Show Gist options
  • Select an option

  • Save gmfc/5612083 to your computer and use it in GitHub Desktop.

Select an option

Save gmfc/5612083 to your computer and use it in GitHub Desktop.
import javax.swing.*;
class maior{
public static void main(String args[]){
int a,b;
a = Integer.parseInt(JOptionPane.showInputDialog("Entre com o 1° número"));
b = Integer.parseInt(JOptionPane.showInputDialog("Entre com o 2° número"));
JOptionPane.showMessageDialog(null,"O maior dentre os 2 é: "+devmaior(a,b));
}
public static int devmaior(int a, int b){
a=(a>b)?a:b;
return a;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment