JAVA CODE

//Ex3_2 program
import java.applet.Applet;
import java.awt.Graphics;

public class Ex3_2 extends Applet
{
   public void paint (Graphics g)
   {
      int i;

      for (i = 1; i <= 2; i++)
      {
         g.drawLine (0, 50*i, 150, 50*i);
         g.drawLine (50*i, 0, 50*i, 150);
      }
   }
}