What is the output of the following 3D Array
int arr[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12};
what is the output for arr[2][1][0]?

Answer Posted / zohaib brohi

the output will be 11..
first we should make it simple.
just make all the values in that array of 2x2 in 3 block like

1,2,
3,4,

5,6,
7,8,

9,10,
11,12

now we have to find [2][1][0]. it means that the value is in
3rd block becoz array starts from 0, then [1][0] means 1st
value of 2nd row.. so thats 11.

Is This Answer Correct ?    112 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can recursive program be written in C++?

625


When must you use a pointer rather than a reference?

598


How do you show the declaration of a virtual constructor?

524


What is a tree in c++?

557


What do you mean by function and operator overloading in c++?

606






What is code reusability in c++?

660


What is the function of I/O library in C++ ?

654


What is guard code in c++?

629


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1072


Is c++ a low level language?

507


What is the use of class in c++?

560


What are proxy objects in c++?

634


Can you Mention some Application of C/C++?

619


Explain the concept of dynamic allocation of memory?

612


Is c++ high level programming language?

669