adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <stdio.h>
    using namespace std;
    int main()
    {
        int array[] = {10, 20, 30};
        cout << -2[array];
        return 0;
    }

a.

-15

b.

-30

c.

compile time error

d.

garbage value

Answer: (b).-30

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?