I am using DevC++ 4.9, running on WinXP SP3 (32bit), here is the code:
#include <stdio.h>
#include <stdlib.h>
main(int argc, char *argv[])
{
double value;
int i;
printf("Enter double: ");
scanf("%lf", &value);
i = value*100;
printf("double: %lf\n", value);
printf("int: %d\n", i);
system("PAUSE");
}
I have entered different values and here are the results:
Test 1:

Test 2:

Test 3:

Why Test 1 and Test 2 displayed different results??
This is due to floating-point round-off:
What Every Computer Scientist Should Know About Floating-Point Arithmetic:
http://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html
3.07cannot be exactly represented in binary. In your case, it’s being rounded to slightly less than3.07, therefore100 * 3.07is evaluating to306.9999999..., which is truncated to 306.Same applies to
3.05. But3.06, is rounded slightly up. So100 * 3.06correctly shows up as 306.