#include<stdio.h>
int main(){
int i=10;
int *ptr=&i;
*ptr=(int *)20;
printf("%d",i);
return 0;
}

Output: 20
can anyone explain how came the output is 20


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C Interview Questions

wat is the output int main() { char s1[]="Hello"; char s2[]="Hello"; if(s1==s2) printf("Same"); else printf("Diff"); }

3 Answers  


What does d mean?

0 Answers  


What is the c value paradox and how is it explained?

0 Answers  


main() { int age; float ht; printf("Enter height and age"); scanf("%d%d",&height,&age); if((age<=20)&&(ht>=5)) {printf("She loves you");} else {printf("She loves you");} }

2 Answers  


what is the difference between procedure oriented and object oriented progaming language

1 Answers  






If an old women's age is the same as her three grand daughters i,mean the number of days old child=the no of weeks old child=no of months old child .The total yrs of all these ppl is 114 yrs...then how old is the old woman? the yr has 365 days..and 30 days each month.

1 Answers   TCS,


What do you mean by dynamic memory allocation in c?

0 Answers  


What is structure data type in c?

0 Answers  


main() { int i=5; printf("%d",++i + i); } output is 10 ------------------------ main() { int i=5; printf("%d",i++ + i); }output is 12 why it is so? give appropiate reason....

2 Answers  


What is structure of c program?

0 Answers  


Discuss similarities and differences of Multiprogramming OS and multiprocessing OS?

4 Answers   TCS,


Write a program to print distinct words in an input along with their count in input in decreasing order of their count..

1 Answers  


Categories