title: How to generate a right angle Fibonacci Series pyramid in Java?
body: <p><strong>I want to generate an output like this :-</strong></p>
  
  <p>0</p>
  
  <p>0 1</p>
  
  <p>0 1 1</p>
  
  <p>0 1 1 2</p>
  
  <p>0 1 1 2 3</p>
  
  <p>0 1 1 2  3 5 </p>
  
  <p>However, i am trying in this way to achieve , but some piece of logic is missing which i am unable to decipher. </p>
  
  <p><strong>Here's what i am trying :-</strong></p>
  
  <pre><code>import java.util.Scanner;
  
  class Fibonacci
  
  {
  
  public static void main(String arr[])
  
  {
  
  System.out.println("Enter a no.");
  
  Scanner input=new Scanner(System.in);
  
  int num=input.nextInt();
  
  int x=0,y=1;
  
  for(int i=0;i&lt;=num;i++)
  
  {
  
  for(int j=0;j&lt;i;j++)
  
  {
  
  System.out.print(j);
  
  }
  
  System.out.println("");
  
  }
  
  }
  
  }
  </code></pre>
  
  <p>And it generates the output like this <em>(consider num=6)</em></p>
  
  <p>0</p>
  
  <p>0 1</p>
  
  <p>0 1 2</p>
  
  <p>0 1 2 3</p>
  
  <p>0 1 2 3 4</p>
  
  <p>0 1 2 3 4 5</p>
  
  <p>What logic is required to get the desired output ? Would be thankful if anyone can explain me this :)</p>
  
  <p>Thanks in advance !!</p>