ProgrammingHardTCS NQT · Infosys
int arr[10]; What is sizeof(int[10]) / sizeof(int)?
- A. 40
- B. 1
- C. 4
- D. 10
Correct answer: D. 10
sizeof(int[10]) is ten times sizeof(int), so the ratio is 10 on every platform. The sizeof values themselves are not fixed, but the ratio is.
More C Programming questions
- What does printf("%d", 10 / 3 3 == 10) print?
- int x = 3; printf("%d", x << 2 | x >> 1); What is printed?
- unsigned char c = 0x80; c >>= 1; printf("%d", c); What is printed?
- uint64t big = (uint64t)0xFFFFFFFF 2; What is big?
- enum { A, B = 5, C }; What is the value of C?
- How many integers from 1 to 100 are divisible by 3 or by 5?