CodePudding user response:
Formulas are derived,,,,,,,CodePudding user response:
#include#include
Int main ()
{
int i=1;
int sum=0;
While (I & lt; 10000)
{
If (I % 2==0)
sum +=i;
i++;
}
Printf (" % d ", sum);
return 0;
}
CodePudding user response:
Arithmetic series summation formula2 + 4 + 6 +... + 100000=2 * (1 + 2 + 3 +... * (50000 + 50000)=2 + 1) * 50000/2=(50000 + 1) * 50000
CodePudding user response:
For (I=2; i<=10000; I +=2)The sum +=I;
CodePudding user response: