21.
#include
int a,b,i,j,cnt=0,sum=0; b=-1;
for(i=500;i<=800;i++) { } 22.
for(j=2;j
if(j>i-1) { }
cnt++; a=b*i; sum+=a; b=-b;
}
printf(\return 0;
#include
int i=2,A1=1,A2=1,A3,A4,n,M=10,j,S1=2,S2=0; for(n=1;n<=3;n++)
{ M=M*10;
for(j=1;S1+A4 A3=A1+2*A2; A4=A2+2*A3; S1=S1+A3; S2=S1+A4; A1=A2; A2=A3; i++; } printf(\} return 0; 23. #include { double x1,x2,x3=0,a; scanf(\ x1=a; while(fabs(x1-x3)>=0.00001) { x2=(x1+a/x1)/2; x3=x1; x1=x2; } printf(\ return 0; } 24. #include double a=1,sum=0; for(i=1;1/a>=0.000001;i++) { if(i%2==0)sum=sum-1/a; else sum=sum+1/a; a=a+2; } sum=sum*4; printf(\return 0;