Cannot generate output(for loops)
<p>I am trying to print</p>

<pre><code>****1
***22
**333
*4444
55555
</code></pre>

<p>As i am a beginner in java.I just print </p>

<pre><code>11111
22222
33333
44444
55555        
</code></pre>

<p>My solution:</p>

<pre><code>for (int i = 1 ; i &lt;= 5 ; i++){
    for(int j = 1 ; j &lt;= 5 ; j++){
        System.out.print(i);
    }
    System.out.println();
}
</code></pre>

<p>and </p>

<pre><code>****
***
**
*
</code></pre>

<p>My solution:</p>

<pre><code> for(int i=1;i&lt;=4;i++){
     for(int j=1;j&lt;=5-i;j++){
         System.out.print("*");
     }
     System.out.println();
 }
</code></pre>

<p>I tried merging them together but i have no idea how to do so.I know i am rather close but i am stuck here.</p>
