i have some problem about integer conversion Pls help! 1. what will happen if i make a float variable to the integer or char? e.g: float a=2.02342; int x; char y; x=a; y=a; what will happen ? x=? y=? 2. in case of the data will be affected in change variable type. How can i convert the integer parts of the float to int? e.g a=2.35325325 Y=a; how can i change a to 2? if a=2.655775 y=a; how can i change a to 3? thx 2.
That test program is seriously buggy. The %f format specifier in the first two printf() calls must be changed to %d or a similar one. The fact that the first printf() still works smells of an over-optimization, or pure luck.