C examples for Data Type:double
Calculates foot lengths for several sizes with while loop
#include <stdio.h> #define ADJUST 7.31 // one kind of symbolic constant int main(void){ const double SCALE = 0.333; // another kind of symbolic constant double shoe, foot; /*from ww w .j ava2 s .co m*/ shoe = 3.0; while (shoe < 18.5) { foot = SCALE * shoe + ADJUST; printf("%10.1f %15.2f inches\n", shoe, foot); shoe = shoe + 1.0; } printf("done.\n"); return 0; }