int a=3.14*150;
printf("%d",a);
return 0;
This works fine, output is 471
int a=3.14*150;
printf("%f",a);
return 0;
but now the output is -0.104279 I thought int will be promoted to float but output is totally different I am using gcc 4.7.2 ubuntu 12.10