@arjun sir and @manojK I ran it again without the condition and o/p is still 64
but my confusion is in there 2 lines
ptr=(char *)&a;
printf("%d",*ptr);
a has a value 320 . in first line we are type casting the address of the value a , just for example let say the address of a is 100 (this is what i understood from this how do i know what is the address of a and what would be the value of it after type casting into char) now first line typecasting that short value in char and storing into ptr .now how am i getting 64 ?
the compiler did not say anything why it gave 64 to me.