Answer to Question #253951 in C++ for Ritz

Question #253951
Design an algorithm which generates even numbers between 1000 and 2000 and then prints them in the standard output. It should also print total sum.
1
Expert's answer
2021-10-20T07:39:14-0400
#include <iostream>

using namespace std;

int main() {
  for (int i = 1000; i <= 2000, i += 2)
    cout << i << endl;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS