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