Answer:
#include <iostream>
using namespace std;
int main() {
int n = 1000;
int sum = 0;
while(n <= 2000) {
sum += n;
n += 2;
}
cout << "sum of even numbers in [1000..2000] = " << sum << endl;
}
Explanation:
This will output:
sum of even numbers in [1000..2000] = 751500