title: Printing a checker board with nested loops. [Java]
body: <p>I'm having issues with getting my code to print. I need to print a checker board with a grid the size of a user input.</p>
  
  <p>Example of what it should output.</p>
  
  <pre><code>Input a size (must be larger than 1):
  5
  
  0 *   *   *
  1   *   *  
  2 *   *   *
  3   *   *  
  4 *   *   *
  </code></pre>
  
  <p>Here's my code:</p>
  
  <pre><code>import java.util.Scanner;
  public class nestedpractice1 
  {
      public static void main(String[] args)
      {
          Scanner kbinput = new Scanner(System.in); 
          //Create Size variable
          System.out.println("Input a size: ");
          int n = 0; n = kbinput.nextInt();
  
          for(int r = 0; r &lt; n; r++)
          {
              for(int c = 0; c &lt; r; c++)
                      {
                  if((r%2) == 0)
                  {
                      System.out.print("*");
                  }
                  else if((r%1) == 0)
                  {
                      System.out.print(" *");
                  }
              }
              System.out.println("");
              kbinput.close();
          }
      }
  }
  </code></pre>
  
  <p>My code keeps printing</p>
  
  <pre><code>**
  
  ****
  </code></pre>