QuestionQ42Verified/Control Flow – Conditional Blocks and LoopsCopy linkReport a problemAsk AstroTutorSave questionWhat should replace ??? so that the program tests whether a number is even? Ax % ‘even’ == TrueBx % 2 == 1Cx % 2 == 0Dx % x == 0Ex % 1 == 2Show AnswerAnswerExplanationThe 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.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion