ProgrammingVery hardGATE CS · Campus placements
uint32_t r = 2147483648u % 1000u; What is r?
- A. 483
- B. 147
- C. 648
- D. 0
Correct answer: C. 648
2^31 = 2147483648 fits in uint32_t, and its last three digits are 648. The remainder is therefore 648.
More C Programming questions
- uint32t p = 65536u 65537u; What is p?
- int a[] = {1, 2, 3, 4, 5}; int p = a; p += 3; printf("%d", p--); What is printed?
- int x = 10; int px = &x; px += px 2; What is x?
- What is ~0u / 2 + 1 for a 32-bit unsigned int?
- What does (unsigned int)(-1) % 10 evaluate to on a platform with a 32-bit unsigned int?
- How many ways are there to write 5 as an unordered sum of 1s and 2s?