fork(2) download
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <float.h>
  4.  
  5. int main(void)
  6. {
  7. float f=200.02;
  8.  
  9. int int_part = (int)f;
  10. float fractional = round(f*100)/100-int_part;
  11. int fractional_part_in_integer = (int)(fractional*100);
  12.  
  13. printf("%d, %d\n ", int_part, fractional_part_in_integer);
  14.  
  15. }
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
200, 2