C | Operators | Question 21
Assume that the size of an integer is 4 bytes, predict the output of following program.
#include <stdio.h> int main() { int i = 12; int j = sizeof(i++); printf("%d %d", i, j); return 0; } |
chevron_right
filter_none
(A) 12 4
(B) 13 4
(C) Compiler Error
(D) 0 4
Answer: (A)
Explanation: The expressions written inside sizeof are not evaluated, so i++ is not performed.
Quiz of this Question
Recommended Posts:
- Operators in C | Set 2 (Relational and Logical Operators)
- C | Operators | Question 6
- C | Operators | Question 24
- C | Operators | Question 23
- C | Operators | Question 15
- C | Operators | Question 5
- C | Operators | Question 26
- C | Operators | Question 4
- C | Operators | Question 1
- C | Operators | Question 3
- C | Operators | Question 27
- C | Operators | Question 2
- C | Operators | Question 26
- C | Operators | Question 22
- C | Operators | Question 27



