Ask Question
2 November, 02:22

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

+1
Answers (1)
  1. 2 November, 04:21
    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?
Get an answer to your question ✅ “Write an algorithm to display the even number from 2 to 20 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers