C Extract Whole Part from Fractions

Here we have a problem to separate a real part and fraction part of a number only using data declarations.  Casting and conversion is not applicable.

Let we have a number x, that is float type, i.e. it has fraction part.

float x;

As we knew that, integer data type variables only assigned with whole numbers.  Assignment of fractions, fraction part is truncated. So,

int y = x;

will assign whole part to y.  Now, fraction part is just difference between number and its whole part. Thus, fraction part may be assigned to variable z as

float z = (x - y);

Now, we can print the whole and fraction parts of number x, as y and z respectively.