Write an expression that evaluates to true if the value of the integer variable numberOfPrizes is divisible (with no remainder) by the integer variable numberOfParticipants. Assume that numberOfParticipants is not zero.

Answer :

Answer:

number Of Prizes % number Of Participants == 0

When we talk about division, a number 'A' is divisible by any other number 'B',

it means the remainder after division must be 0. And, we denote division for getting the remainder by '%' sign.

So, As per the question, we have to check whether numberOfPrizes is divisible by numberOfParticipants, the expression is

number Of Prizes % number Of Participants == 0

If number Of Prizes % number Of Participants == 0, condition satisfies, the answer will be True otherwise False

Other Questions