title: For loop to print the number in sequence and reverse it
body: <p>How to print the following output with only one for-loop in java?</p>
  
  <pre><code> 1 2 3 4 5 6 7 8 9 1 0 9 8 7 6 5 4 3 2 1 
  </code></pre>
  
  <p>Code snippet:</p>
  
  <pre><code>class Series{
  
  public static void main(String args[]){
  
      for(int i=1; i&lt;=10; i++){
  
           System.out.println(i);
      }
  
      System.out.println(i);
  
      for(int j=9; j&gt;=0; j--){
  
           System.out.println(j);        
     }          
  } 
  </code></pre>
  
  <p>My program's in the following manner. Can anyone correct it?</p>