Question
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int array[] = {10, 20, 30};
6.
cout << -2[array];
7.
return 0;
8.
}
What is the output of this program?
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
int array[] = {10, 20, 30};
6.
cout << -2[array];
7.
return 0;
8.
}
Answer: Option B
Was this answer helpful ?
It's just printing the negative value of the concern element.
$ g++ array.cpp
$ a.out
-30
Was this answer helpful ?
More Questions on This Topic :
Question 8.
What is a array?
....
Submit Solution