I was solving the programming question when I encountered this.Code:#include <iostream> using namespace std; int main() { int a[]={1,2,3,4}; int *arr[5]={a,a+1,a+2,a+3,a+4}; int *p=a+4; cout<<p[*arr[1]-5]; return 0; }
My answer to this code was a printed garbage value. But, turns out the answer is 2.