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

What are c++ stream classes?

562


How did c++ get its name?

575


What is a storage class used in c++?

618


What are the basics of local (auto) objects?

634


What is static function? Explain with an example

560






What are the new features that iso/ansi c++ has added to original c++ specifications?

588


Explain the use of virtual destructor?

627


Define what is constructor?

590


How do you invoke a base member function from a derived class in which you’ve overridden that function?

586


Which is better c++ or java?

566


List the merits and demerits of declaring a nested class in C++?

611


What are manipulators used for?

613


What is flush programming?

578


Write a function that swaps the values of two integers, using int* as the argument type?

610


What is a c++ class?

625