Example #1
0
main()
{
    int fahr;

    for (fahr = 0; fahr <= 300; fahr = fahr + 20) {
        printf("%3d %6.1d\n", fahr, to_celsius(fahr));
    }
}
Example #2
0
int main()
{
  float fahr, celsius;
  float lower, upper, step;

  lower = 0;    /* lower limit of temperature scale */
  upper = 300;   /* upper limit */
  step = 20;    /* step size */

  fahr = lower;
  while (fahr <= upper) {
    celsius = to_celsius(fahr);
    printf("%3.0f %6.1f\n", fahr, celsius);
    fahr = fahr + step;
  }
}
Example #3
0
int main() {
  float fahr;
  float lower, upper, step;

  lower = 0;
  upper = 300;
  step = 20;

  fahr = lower;

  printf("fahrenheit  celcius\n");

  while (fahr <= upper) {
    printf("%10.0f %8.1f\n", fahr, to_celsius(fahr));
    fahr = fahr + step;
  }
}