akikogrg123 akikogrg123
  • 13-12-2020
  • Computers and Technology
contestada

write an algorithm to sumn of even numbers from 1 to 10​

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 18-12-2020

Answer:

1. Start

2. Evensum = 0

3. For I = 1 to 10

3.1 If I % 2 == 0

3.1.1 Evensum = Evensum + I

4. Print Evensum

5. Stop

Explanation:

The line by line explanation is as follows:

[The algorithm starts here]

1. Start

[This initializes Evensum to 0]

2. Evensum = 0

[This iterates from 1 to 10, inclusive]

3. For I = 1 to 10

[This checks if current number is even number]

3.1 If I % 2 == 0

[If yes, this adds the even number]

3.1.1 Evensum = Evensum + I

[This prints the sum after the sum]

4. Print Evensum

[This ends the algorithm]

5. Stop

Answer Link

Otras preguntas

uestion 1 (2 points) Question 1 Unsaved Elige la palabra que completa la oración siguiente. 2 points Carmen es alumna en una escuela ________. Tiene dieciséis a
Which of these items best describes the arrangement of electrons in an atom of sulfur? A. Eight electrons in its first energy level; eight valence elec
HELP WITH THESE! IVE ASKED 5 TIMES!
How do long term goals differ from short term goals
Which of the following functions has the greatest y-intercept? A) f(x) B) g(x) C) f(x) and g(x) have the same y-intercept D) Not enough information
x+y-3+-x+2y+4........
Can someone please explain how to do this ?
Which of the following is an example of a decomposer? Tree Hawk Rabbit Mushroom
Who invented the movable type printing press?
I need help writing a paragraph about where i see myself in ten years and i cant thing of anything