Let E be the sum of 2, 4, 6, ..., 100. Let O be the sum of 1, 3, 5, ..., 999. Find E - O.
sumfor(n, 1, 50, 2*n)=2550 - sumfor(n, 1,50, 2*n-1)=2500 = 50
Note: I assumed that your last 999 was meant to be 99. If I'm wrong, then please let us know.