Comprehensive and Detailed Explanation From Exact Extract:
To find the rightmost digit of an integer q = 7777, we need the units digit (i.e., 7). According to foundational programming principles, the modulo operator (%) with 10 isolates the rightmost digit of a number.
Option A: "10 % q."
Compute: 10 % 7777 = 10 (since 10 ÷ 7777 has a remainder of 10).
Result: 10 ≠ 7. Incorrect.
Option B: "q % 10."
Compute: 7777 % 10 = 7 (remainder of 7777 ÷ 10, isolating the units digit).
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit