ProgrammingModerate
What is the multiplicative inverse of 2 modulo 7?
- A. 3
- B. 4
- C. 2
- D. 7
Correct answer: B. 4
2 x 4 = 8 = 1 (mod 7). Note that 3 gives 6, which is -1, not 1.
More C Programming questions
- In C, what is the result of 7 / -2 and 7 % -2?
- An unsigned short variable holds 65535 and is then incremented once with x++. What value does it hold?
- Which statement about left-shifting a negative signed integer in C is correct?
- How many subsets of {1, 2, 3, 4} (including the empty set) have XOR equal to 0?
- What is the result of (0xFFu >> 4) | (0x0Fu << 4) & 0xFF?
- How many times does cnt++ run in: for (i = 0; i < 10; i++) for (j = i; j < 10; j++) cnt++; ?