Facebook
From Elvina, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 84
  1. import javax.swing.JOptionPane;
  2.  
  3. public class Gui {
  4.  
  5.         public static void main(String[] args) {
  6.          String inputData = JOptionPane.showInputDialog("Enter number");
  7.             int userNumber = Integer.parseInt(inputData);
  8.             JOptionPane.showMessageDialog(null,"the number "+(userNumber%2==0?"even":"odd"));
  9.             }
  10. }
  11.