adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <stdio.h>
    using namespace std;
    int main()
    {
        int a = 5, b = 10, c = 15;
        int arr[3] = {&a, &b, &c};
        cout << *arr[*arr[1] - 8];
        return 0;
    }

a.

15

b.

18

c.

garbage value

d.

compile time error

Answer: (d).compile time error

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?