extract decimal and integer portion separately

Example


#include<stdio.h>
int main() {
  double num = 233.3456;
  int intpart = (int)num;
  double decpart = num - intpart;
  printf("Num = %f, intpart = %d, decpart = %f\n", num, intpart, decpart);
  getchar();
  return 0;
}