例2.19
程序员文章站
2022-06-30 09:14:54
...
例2.19
![#include<stdio.h>
int main()
{
int sign=1;
double deno =2.0,sum=1.0,term;
while(deno<=100)
{
sign=-sign;
term=sign/deno;
sum=sum+term;
deno=deno+1;
}
printf("%d\n",sum);
return 0;
}