How to store whole number in another variable

How can I store whole number in another variable and fractional number in another variable input by the user?
For Example:
If user input => 3.45
So How I store whole number 3 in another variable and 0.45 in another variable?

Considered
Float f = 3.45;
Int a = (int)f;
Which is convert into 3 only

1 Like