Start set num = 0 display " enter the number" read num if ( remainder (num / 2…

2018

Start set num = 0 display " enter the number" read num if ( remainder (num / 2 ) = 0 ) display "yes" else display "no" end

If the output of the above algorithm is "yes", it indicates that num is

  1. A.

    Even number

  2. B.

    Amstrong number

  3. C.

    Odd number

  4. D.

    Prime number

Attempted by 199 students.

Show answer & explanation

Correct answer: A

The algorithm checks the condition remainder(num / 2) = 0. When a number is divided by 2 and leaves a remainder of 0, it means the number is perfectly divisible by 2. This is the defining characteristic of an even number. Thus, option A is correct.

Explore the full course: Btsc Lab Assistant