C | Operators | Question 8
#include <stdio.h> int main() { //Assume sizeof character is 1 byte and sizeof integer is 4 bytes printf("%d", sizeof(printf("GeeksQuiz"))); return 0; } |
chevron_right
filter_none
(A) GeeksQuiz4
(B) 4GeeksQuiz
(C) GeeksQuiz9
(D) 4
(E) Compile-time error
Answer: (D)
Explanation: An expression doesn’t get evaluated inside sizeof operator. GeeksQuiz will not be printed. printf returns the number of characters to be printed i.e. 9 which is an integer value. sizeof operator returns sizeof(int).
Recommended Posts:
- Operators in C | Set 2 (Relational and Logical Operators)
- C | Operators | Question 18
- C | Operators | Question 2
- C | Operators | Question 16
- C | Operators | Question 3
- C | Operators | Question 4
- C | Operators | Question 15
- C | Operators | Question 27
- C | Operators | Question 12
- C | Operators | Question 5
- C | Operators | Question 6
- C | Operators | Question 11
- C | Operators | Question 10
- C | Operators | Question 26
- C | Operators | Question 27



