#include<stdio.h>
int main()
{
double fract=0;
int tmp;
//scanf("%lf",&fract);
fract=0.312;
printf("%lf",fract);
printf("\n\n");
while(fract>0){
fract*=(double)10;
printf("%d ",(int)fract);
fract-=(int)fract;
}
getch();
return 0;
}
this code shoud have an output of: 312
but somehing isn't going right.. i'm using devcpp 4.9.9.2 compiler...