Skip to content
Related Articles

Related Articles

C | Misc | Question 9
  • Last Updated : 13 Sep, 2015




#include <stdio.h>
#include <string.h>
int main()
{
    char a[] = {'G','E','E','K','S','Q','U','I','Z'};
    char b[] = "QUIZ";
    char c[] = "GEEKS";
    char d[] = "1234";
    int l = strlen(a);
    int o = printf("%d", sizeof((sizeof(l)+(c[5]+d[0]+a[1]+b[2]))) );
    printf("%c", a[o]);
    return 0;
}

Thanks to Gokul for contributing this question.
(A) 4E
(B) 8E
(C) 1234Q
(D) Compiler Dependent


Answer: (D)

Explanation: The output seems is compiler dependent. It depends on the size of return type of sizeof. The return type of sizeof is std::size_t. The size of size_t is 4 bytes in some compilers and 8 bytes in some other.

Quiz of this Question

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :