Next: Weight Conversion Table Up: A Quick Overview Previous: A
Very Simple  A Weight Conversion Program  #include <stdio.h>
#define KILOS_PER_POUND .45359 {       int pounds;
for(pounds=10; pounds < 250; pounds+=10)         {       int
stones = pounds / 14;                 int uklbs = pounds % 14;
float kilos = pounds * KILOS_PER_POUND;                 printf("
%d           %d   %d        %f\n",
pounds, stones, uklbs, kilos);  Again notice that the only
function is called main.  int pounds; Creates a variable of
integer type called pounds.  float kilos; Creates a floating
point variable (real number) called kilos.  #define
KILOS_PER_POUND .45359 defines a constant called
KILOS_PER_POUND. This definition will be true throughout the
program. It is customary to use capital letters for the names of
constants, since they are implemented by the C preprocessor.
This is the start of the loop. All statements enclosed in the
following curly brackets will b