C | Misc | Question 9
#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
Please Login to comment...