import java.awt.Graphics;
import java.applet.Applet;

public class piApplet extends Applet
{
    public void paint(Graphics g)
    {
       int i;
       double pi=0;
       int artieksi=-1;
       for(i=1;i < 100000;i++) 
       {
          artieksi*=-1;
          pi+=4/(2.0*i-1.0)*artieksi;
       }
       g.drawString("pi : "+pi,25,25);
       g.drawString("pi nin gercek degeri: "+Math.PI,25,40);
    }
}
