fork download
  1. #include <stdio.h> //scanf
  2. #include <stdlib.h> //EXIT_SUCCESS
  3. #include <math.h> //floorf
  4.  
  5.  
  6. int isInt(float f) {
  7. return (floorf(f) == f);
  8. }
  9.  
  10. int main(void) {
  11. float val = 0.0;
  12.  
  13. scanf("%f", &val);
  14. printf("val == %.8f\n", val);
  15. printf("is int: %d (1 TAK, 0 NIE)\n", isInt(val));
  16. return EXIT_SUCCESS;
  17. }
Success #stdin #stdout 0s 2296KB
stdin
numm
35
stdout
val == 0.00000000
is int:  1 (1 TAK, 0 NIE)