ProgrammingModerate
printf("%d", sizeof(int[4]) / sizeof(int)); What is printed with 4-byte int?
- A. 16
- B. 4
- C. 1
- D. 8
Correct answer: B. 4
sizeof(int[4]) is 16 bytes, and dividing by 4 gives the element count, 4.
More C Programming questions
- printf("%d", (int)(0.1 + 0.2 == 0.3)); What is printed in IEEE double arithmetic?
- printf("%d", 'a' < 'b' && 'b' < 'c'); What is printed?
- printf("%d %d", 5 / 2, -5 / 2); What is printed in C99?
- What is printed? c #include <stdint.h> #include <stdio.h> int main(void) { uint32t v = 0x00F0F0A5u; v = v - ((v >> 1) & 0x55555555u); v =…
- What is printed? c #include <stdio.h> #include <string.h> #include <stdlib.h> int cmp(const void a, const void b) { const char x = (const…
- What is printed? c #include <stdio.h> int main(void) { int m[2][3] = {{1, 2, 3}, {4, 5, 6}}, t[3][2]; for (int i = 0; i < 2; i++) for (int…