Ask Question

Write an algorithm to display the even number from 2 to 20

+3
Answers (1)
  1. 26 January, 20:11
    0
    Step 1: START

    Step 2: For I = 2 to 20

    Step 3: if I %2 = = 0

    Step 4: PRINT I

    Step 5: I = I + 2

    Step 6: NEXT I

    Step 7: STOP

    Explanation:

    The output of the above algorithm will be

    2 4 6 8 10 12 14 16 18 20

    Above, we are using the for loop, and it starts with I = 2, and with every iteration I is incremented by 2. And hence, we get the above output.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write an algorithm to display the even number from 2 to 20 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers