ProgrammingVery hardGATE CS · Campus placements
uint32_t x = 0u; x -= 1; x = x / 2 + 1; What is x?
- A. 4294967295
- B. 2147483647
- C. 2147483649
- D. 2147483648
Correct answer: D. 2147483648
x wraps to 4294967295, and dividing by 2 gives 2147483647. Adding 1 produces 2147483648.
More C Programming questions
- int a[5]; int p = &a[4]; printf("%td", p - &a[0]); What is printed?
- What does printf("%d", '7' - '0' == 7) print?
- Reversing the list 1 -> 2 -> 3 -> 4 -> 5 in place with the usual three-pointer loop, what are head->v and head->next->v afterwards?
- In a list 1 -> 2 -> 3 -> 4 -> 2 where the last node points back to the node holding 2, Floyd's method runs slow = slow->next and fast =…
- A pointer-to-pointer loop deletes every node holding 2 from 2 -> 2 -> 3 -> 2 -> 1, using struct N pp = &head and advancing only when no…
- Which code correctly removes node p from a doubly linked list, where p->prev and p->next may be NULL, and then frees it?