• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

C Quiz - 102 | Question 5

In the context of the below program snippet, pick the best answer. C
#include \"stdio.h\"
int arr[10][10][10];
int main()
{
 arr[5][5][5] = 123;
 return 0;
}
Which of the given printf statement(s) would be able to print arr[5][5][5] C
(i) printf(\"%d\",arr[5][5][5]);
(ii) printf(\"%d\",*(*(*(arr+5)+5)+5));
(iii) printf(\"%d\",(*(*(arr+5)+5))[5]);
(iv) printf(\"%d\",*((*(arr+5))[5]+5));

(A)

only (i) would compile and print 123.

(B)

both (i) and (ii) would compile and both would print 123.

(C)

only (i), (ii) and (iii) would compile but only (i) and (ii) would print 123.

(D)

only (i), (ii) and (iii) would compile and all three would print 123.

(E)

all (i), (ii), (iii) and (iv) would compile but only (i) and (ii) would print 123.

(F)

all (i), (ii), (iii) and (iv) would compile and all would print 123.

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments