/* Yet another Kernighan & Ritchie C Answers set */

Sunday, March 28, 2010

 

Chapter 1 Exercise 4

#include 
main()
{ float fahr, cels;
 int lower, upper, step;
 lower = 0;
 upper = 200;
 step = 10;
 cels = lower;
 printf("Cels\tFahr\n");
 while (cels <= upper)
 { fahr = 32.0 + 9.0/5.0 * cels;
  printf("%4.0f\t%4.0f\n", cels, fahr);
  cels = cels + step;
 }
}

Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

Archives

March 2010  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]