This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

urgent! variable type conversion

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.