The Wayback Machine - https://web.archive.org/web/20240225001054/https://www.geeksforgeeks.org/c-operators-question-8/
Open In App
Related Articles

C | Operators | Question 8

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report
#include <stdio.h>
int main()
{
    //Assume sizeof character is 1 byte and sizeof integer is 4 bytes
    printf("%d", sizeof(printf("GeeksQuiz")));
    return 0;
}

                    
(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).

Last Updated : 18 Jan, 2013
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads