title: Java Pattern of 1 row odd and 1 row even
body: <p>I want to print a pattern like :</p>
  
  <p><img src="https://i.stack.imgur.com/sAmez.png" alt="This is Required pattern"></p>
  
  <p>Till now i  have been able to achieve only for odd numbers like :</p>
  
  <pre><code>1 
  3 5 7 
  </code></pre>
  
  <p>-</p>
  
  <pre><code>Scanner kb = new Scanner(System.in);
  int num = kb.nextInt();
  while (num % 2 == 0 || num &lt; 0) {
      num = kb.nextInt();
  }
  int odd = 1;
  for (int i = 1; i &lt;= num; i += 2) {
      String a = "";
      for (int j = 1; j &lt;= i; j++) {
          a = odd + " ";
          odd += 2;
          System.out.print(a);
      }
      System.out.println();
  }
  </code></pre>
  
  <p>I am a beginner and new learner. please help</p>