I am trying to separate a double into the integer and decimal parts
So for example, the number 24.4 should be separated into 24 and 4.
int integer =
![Here is my Solution][1]
here is my solution. I used a simple method in C Programming to split the Fractional Numbers in two Different Integers...Here below is the Code
#include
void main()
{
float x=24.56; int y=(int)x; float z=(x-y)*1000000000; int zd=(int)z;
printf("%lf",x);
printf("\ninteger Part %d\n",y);
printf("\nDecimal Part %d\n",zd);
}
Output
24.559999 integer Part 24
Decimal Part 559999488