QuestionQ42

VerifiedControl Flow – Conditional Blocks and Loops

What should replace ??? so that the program tests whether a number is even?

Question Image

Explanation

The modulo operator % returns the remainder after division. An even integer has a remainder of 0 when divided by 2, so x % 2 == 0 is the required condition.

Community Discussion

No comments yet. Be the first to start the discussion!