int data[]={10,20,30,40,50};int *p=data;what will be the value of the following expression I) -2[p]
II) p[p-data]
Answers
Answered by
0
Answer:
I) -30
II) 10
Explanation:
int main(){
int data[]={10,20,30,40,50};
int *p=data;
cout<<*p<<endl; //*p=10
int res;
res=-2[p];
cout<<res<<endl; //res=-30
res=0;
res=p[p-data];
cout<<res; //res=10
return 0;
}
Similar questions