Advertisement
gastaojunior

EstruturaSelecaoComposta

Mar 15th, 2012
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. package exemplosjava;
  2.  
  3. import javax.swing.JOptionPane;
  4.  
  5. public class EstruturaSelecaoComposta {
  6.  
  7.     public static void main(String[] args) {
  8.         int numero;
  9.         numero = Integer.parseInt(JOptionPane.showInputDialog("Digite um numero:"));
  10.         if (numero % 2 == 1) {
  11.             JOptionPane.showMessageDialog(null, "O numero é impar");
  12.         }else{
  13.             JOptionPane.showMessageDialog(null, "O numero é par");
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement