Can someone explain to me that why is there a junk value in 'f' after again being assigned by pointer 'pf'? and what is assigned to the pointer 'pf' by 'pi'?
Because integers and floats are stored in completely different formats.
Taking the address of an integer and pretending that a floating point number is strored there
(which is really what this cast pf=(float*)pi; is doing), and trying to print is as a float
will obviously produce rubbish.