fork(1) download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5. double integral = 0.0f;
  6. double fractional = 0.0f;
  7. double num = 100.0f;
  8.  
  9. fractional = modf(num, &integral);
  10.  
  11. if ((num >= 0) && (fractional == 0.0))
  12. {
  13. printf("Natural!\n");
  14. }
  15. else
  16. {
  17. printf("Unnatural.\n");
  18. }
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
Natural!