Question 12
Back to Exercise
What is the output of the following program, compiled as C23 on 64-bit Linux or macOS?
#include <stdio.h>
int main(void) {
auto big = 10L;
auto u = 3u;
auto d = 1.5f;
printf("%zu %zu %zu\n", sizeof big, sizeof u, sizeof d);
return 0;
}
- A 8 4 4 Correct
- B 4 4 8
- C 8 4 8
- D Compilation error
Correct Answer: Option A
The suffixes decide the deduced types: 10L is a long (8 bytes on LP64), 3u an unsigned int (4) and 1.5f a float (4).
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!