floatcnv.c 348 B

123456789101112131415
  1. /* floatcnv.c -- mismatched floating-point conversions */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. float n1 = 3.0;
  6. double n2 = 3.0;
  7. long n3 = 2000000000;
  8. long n4 = 1234567890;
  9. printf("%.1e %.1e %.1e %.1e\n", n1, n2, n3, n4);
  10. printf("%ld %ld\n", n3, n4);
  11. printf("%ld %ld %ld %ld\n", n1, n2, n3, n4);
  12. return 0;
  13. }