khalfella

c_ch01_ex05.c

Sep 20th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. /*
  2. * Exercise 1-5.
  3. * Modify the temperature conversion program to print the table
  4. * in reverse order, that is, from 300 degrees to 0.
  5. */
  6.  
  7. #include <stdio.h>
  8.  
  9. main() {
  10. int fahr;
  11. for (fahr = 300; fahr >= 0; fahr = fahr - 20)
  12. printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32));
  13. }
Advertisement
Add Comment
Please, Sign In to add comment