samir82show

c_ch01_ex05.c

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