Q. | What will be output of following c program? #include
int main(){
int x=10;
int *ptr=&x; //statement one
int **temp=&ptr; //statement two
printf("%d %d %d".x.*ptr,**temp);
return 0;
}
|
|||||||
|
Answer: | Option D | |
Explaination: | As we know value of variable x is 10. *ptr= *(&x) //from statement one
=*&x
=x //using cancellation rule
=10
**temp= **(&ptr)=*(*&ptr)=*ptr=*(&x)=*&x=x=10
|
Discussion
Your Comments Goes here... |
Name | Discussion |
---|