take care when ever you use %d and %f %d is not flexible in handling float varibale....do not expect it to typecast itself. reason could be , you are trying to fit large data type i.e float to the int whose range is less.
whereas in second case float can incorporate int type , so automatic typecasting is done. On Mon, Jan 9, 2012 at 10:17 AM, HARSHIT PAHUJA <hpahuja.mn...@gmail.com>wrote: > *#include<stdio.h> > int main() > { > float f=25.25; > printf("%d\n",f); > long int x=90; > printf("%f",x); > return 0; > } > * > > above program gives output > *0 > 25.250000* > > shudn it be : > *25 > 90.0000* > ?? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.