JAVA CODE

// Test3 program, using a nested for loop
import java.applet.Applet;
import java.awt.Graphics;

public class Test3 extends Applet
{
   public void paint (Graphics g)
   {
      int h, i, j;
      for(h=1; h<=2; h++)
       {
        for (i=1; i<=5; i++)
         for (j=1; j<=i; j++)
            g.drawString ("s", 10*j, 10*i+50*h);
       }
   }
}