1
0

showf_pt.c 474 B

12345678910111213141516
  1. /* showf_pt.c -- displays float value in two ways */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. float aboat = 32000.0;
  6. double abet = 2.14e9;
  7. long double dip = 5.32e-5;
  8. printf("%f can be written %e\n", aboat, aboat);
  9. // next line requires C99 or later compliance
  10. printf("And it's %a in hexadecimal, powers of 2 notation\n", aboat);
  11. printf("%f can be written %e\n", abet, abet);
  12. printf("%Lf can be written %Le\n", dip, dip);
  13. return 0;
  14. }