shoes1.c 420 B

123456789101112131415
  1. /* shoes1.c -- converts a shoe size to inches */
  2. #include <stdio.h>
  3. #define ADJUST 7.31 // one kind of symbolic constant
  4. int main(void)
  5. {
  6. const double SCALE = 0.333; // another kind of symbolic constant
  7. double shoe, foot;
  8. shoe = 9.0;
  9. foot = SCALE * shoe + ADJUST;
  10. printf("Shoe size (men's) foot length\n");
  11. printf("%10.1f %15.2f inches\n", shoe, foot);
  12. return 0;
  13. }