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
Math,
5 months ago
Psychology,
5 months ago
Math,
5 months ago
Hindi,
11 months ago
Physics,
11 months ago