1
0

floats.c 416 B

123456789101112131415161718
  1. // floats.c -- some floating-point combinations
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. const double RENT = 3852.99; // const-style constant
  6. printf("*%f*\n", RENT);
  7. printf("*%e*\n", RENT);
  8. printf("*%4.2f*\n", RENT);
  9. printf("*%3.1f*\n", RENT);
  10. printf("*%10.3f*\n", RENT);
  11. printf("*%10.3E*\n", RENT);
  12. printf("*%+4.2f*\n", RENT);
  13. printf("*%010.2f*\n", RENT);
  14. return 0;
  15. }