483,502 views
2 votes
2 votes
1. Design an algorithm and a flowchart which generates even numbers between 1000 and

2000 and then prints them in the standard output. It should also print total sum.

User Miguelao
by
2.8k points

1 Answer

4 votes
4 votes

Here is an algorithm for generating and printing even numbers between 1000 and 2000, along with their sum:

  1. Set a variable total to 0, and a variable current to 1000.
  2. While current is less than or equal to 2000, do the following:
  3. -> If current is even, print it to the standard output.
  4. -> Add current to total.
  5. -> Add 2 to current.
  6. Print the value of total to the standard output.

Here is a flowchart (attached) that outlines the steps of this algorithm:

1. Design an algorithm and a flowchart which generates even numbers between 1000 and-example-1
User Justus
by
3.0k points