clear allclc
flag=-1;counter=1;fore=100;now=0;while abs(fore)>10^-6 flag=flag*-1; fore=1/counter*flag; now=now+fore; counter=counter+2;end
format long;mypi=now*4
clear allclc
flag=-1;counter=1;fore=100;now=0;while abs(fore)>10^-6 flag=flag*-1; fore=1/counter*flag; now=now+fore; counter=counter+2;end
format long;mypi=now*4