Ask Question
22 May, 15:41

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

+3
Answers (1)
  1. 22 May, 18:14
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers