The __________ operator is commonly used to determine whether a number is even or odd.

Giang Phạm

New member
The __________ operator is commonly used to determine whether a number is even or odd.
A. Addition
B. Modulus
C. Subtraction
D. Integer division
 
Answer: B
Explanation: The modulus operator is commonly used to determine whether a number is even or odd. If you divide a number by 2 and the remainder is 0, the number is even, and if the remainder is 1, the number is odd. Thus the result of any number mod 2 determines whether the number is even or odd.
 

Tìm kiếm

Back
Top