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

Assume that Jones Company made a payment on a mortgage. It included $100 of principal and $150 of interest. What would the journal entry be to record the paymen
√25 + √ 81 = ? Heheeh
Which is most likely to help an introduced species become invasive?
Answer fast please and thanks!
Quais foram as dificuldades que tamara teve que enfrentar no mar?
Choose the correct answer from thechoices given below:Which of the following words doesNOT mean "friendly"?BasicAffableAmiable" LogPugnaciousCongenialmoCordial​
disorders of urinary system​
If you borrow $700 for one year at an interest rate of 8% p.a, how much interest will you pay every month?
Define and explain SMART?
Gizmo: Rainfall and Bird Beak Evolution The finches have their young during the rainy season. Based on the table, which part of the year do you think is the rai