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
write a program that reads in a file and counts the number of lines, words, and characters. Your program should ask the user to input a filename. Open the file and report an error if the file does not exist or cannot be opened for some other reason. Then read in the contents of the file and count the number of lines, words, and characters in the file. Also print additional information about the file, such as the longest and shortest words, and longest and shortest lines. For simplicity, we define a word to be one or more characters ending with white space (a space, tab, carriage return, etc.). Functions for checking the types of characters can be found in the ctype.h header file, so you want to include this header file in your program. For example, the sentence below could be all that is in a file. This sentence IT 104 is taught in C++. has 32 characters, one line, and six words. The shortest line is 32 characters. The longest line is 32 characters. The shortest word is 2 characters. The longest word is 6 characters
What are the operators in c++?
What is the default width for ouputting a long integer using the insertion operator?
Do class declarations end with a semicolon?
What are the various arithmetic operators in c++?
Define pure virtual function?
If all is successful, what should main return a) 0 b) 1 c) void
Do you know the problem with overriding functions?
Which is best ide for c++?
Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement
If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?
What are the storage qualifiers?
Explain rtti.
Explain the uses oof nested class?
Explain mutable storage class specifier.