Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int a[2][4] = {3, 6, 9, 12, 15, 18, 21, 24};
6.
cout
Options:
A .  15 18 21
B .  21 21 21
C .  24 24 24
D .  Compile time error
Answer: Option B

a[1][2] means 1 * (4)+2 = 6th element of an array staring from zero.
Output:
$ g++ point.cpp
$ a.out
21 21 21



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :

Latest Videos

Latest Test Papers