title: Checking if a number entered is odd
body: <p>`I'm not sure what code to insert or even where, but I would like to check the number I enter is an odd number.</p>
  
  <pre><code>import java.io.*;
  import javax.swing.JOptionPane;
  
  public class Diamond {
      public static void main(String [] args) throws IOException {
  
          BufferedReader stdin = new BufferedReader (new InputStreamReader (System.in));
          String input; 
          int num;
          System.out.println("input number: ");
          input = stdin.readLine ();
          num = Integer.parseInt(input);
  
          if (num % 2 ==1){
              int d = num;
              int e = 0;
              for (int a = 0; a &lt;= num; a++) {
                  for (int c = d; c&gt;= 1; c-- )
                      System.out.print(" ");
                  d-=1;
                  for (int b = 1; b &lt;= a; b++)
                      System.out.print ("* ");
                  System.out.println();
              }
  
              num-=1;
              for (int a = 0; a&lt;=num; a++) {
                  for (int b = num; b &gt; a; b--)
                      System.out.print (" *"); 
                  System.out.println(); 
                  for (int c = 0; c &lt;= e; c++)
                      System.out.print(" ");
                   e+=1;
              }
          } else {
              System.out.println("Please enter an odd number!");
          }
      }
  }
  </code></pre>