# include
# include
Int main () {
Float s=1.0, t=1.0, n=1.0; While (fabs (t) & gt; 1-5 e)
{t=pow (1, n + 1) * 1.0/(n * n + 1);
S=s + t;
N++; } printf (" % f \ n ", s);
return 0;
}
CodePudding user response:
#includeInt isPrime (int x) {
If (x<2) return 0;
For (int I=2; i
}
return 1;
}
Int main ()
{
Float sum=0.0;
int count=0;
For (int I=100; i<=200; I++) {
{if (isPrime (I))
sum +=i;
count++;
}
}
Printf (" primes average of between 100 ~ 200: % 2 f ", sum/count);
return 0;
}
For your reference