Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

C | Misc | Question 9

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

#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

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads