ProgrammingModerate
int m = 2147483647; printf("%d", m / 2); What is printed with a 32-bit int?
- A. 1073741824
- B. 1073741823
- C. 2147483647
- D. 0
Correct answer: B. 1073741823
INT_MAX is 2147483647, and integer division by 2 truncates to 1073741823.
More C Programming questions
- How many subsets of the bit positions of mask 22 (binary 10110) are visited, counting the empty subset? Compute with this program. c…
- What is printed? c #include <stdio.h> int main(void) { unsigned a = 0xB6, b = 0x3C; printf("%u", a & ~b); }
- What is printed? This program tries every subset of {3, 5, 6} and prints the largest XOR of a subset (the empty subset counts as 0). c…
- What is printed? c #include <stdio.h> char g[3][4] = {"110", "010", "011"}; int fill(int r, int c) { if (r < 0 || c < 0 || r >= 3 || c >=…
- What is printed? c #include <stdio.h> #include <stdlib.h> int cmp(const void a, const void b) { const int x = a, y = b; int sx = x[0] +…
- What is printed? c #include <stdio.h> #include <stdlib.h> struct Item { int id; char tag; }; int cmp(const void k, const void e) { const…