#include <stdio.h>
#include <math.h>
int main(int argc, const char * argv[]){
double pi = 3.14;
double intgerPart;
double fractionPart;
fractionPart = modf(pi, &intgerPart);
printf("Pi's Interger Part is %.0f, and Pi's fraction part is %.2f \n", intgerPart, fractionPart);
return 0;
}
Result:
Pi's Interger Part is 3, and Pi's fraction part is 0.14
Program ended with exit code: 0