Vidyalelo
C++ Programming · Q49

Arrays and Strings in C++

Programming · C++ Programming · question 49

Q49

What will be the output of the following C++ code? #include #include using namespace std; int main() int array[] = 10, 20, 30; cout << -2[array]; return 0;

A.
-15
B.
-30
Answer
C.
compile time error
D.
garbage value

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board