+0  
 
0
558
3
avatar

What is the sum of all even numbers between 10 and 500 inclusive?

 Dec 3, 2019
 #1
avatar+1252 
-1

10+12+14+...+498+500

Pair these up

500+10 is a group which equals 510

498+12 is a group which equals 510

 

Then find how many 510 groups there are, and mulitply that by 510

 Dec 3, 2019
 #3
avatar
+1

Begin:o=0;e=0;listforeach(m, d=(10, 11, 12, 13, 14, 15, 16, ...........496, 497, 498, 499, 500),if(m%2==0,e=e+m, o=o+m);print"Even Num =",e; print"Odd Num   =", o

 

Even Numbers = 62,730
Odd Numbers   = 62,475

 Dec 3, 2019

0 Online Users