/*
Modify the temperature conversion program to print the table in reverse order,
that is, from 300 degrees to 0.
*/ #include <stdio.h> /* print Fahrenheit-Celsius table in reverse order */
main()
{
int fahr; for(fahr = 300; fahr >= 0; fahr -= 20)
{
printf("%3d %6.1f\n", fahr, (5.0 / 9.0) * (fahr - 32));
}
} /* Output: 300 148.9
280 137.8
260 126.7
240 115.6
220 104.4
200 93.3
180 82.2
160 71.1
140 60.0
120 48.9
100 37.8
80 26.7
60 15.6
40 4.4
20 -6.7
0 -17.8
Press any key to continue . . . */

C - The C Answer (2nd Edition) - Exercise 1-5的更多相关文章

  1. C - The C Answer (2nd Edition) - Exercise 1-7

    /* Write a program to print the value of EOF. */ #include <stdio.h> main() { printf("EOF ...

  2. C - The C Answer (2nd Edition) - Exercise 1-2

    /* Experiment to find out what happens when printf's argument string contains \c, where c is some ch ...

  3. C - The C Answer (2nd Edition) - Exercise 1-1

    /* Run the "hello, world" program on your system. Experiment with leaving out parts of the ...

  4. C - The C Answer (2nd Edition) - Exercise 1-16

    /* Revise the main routine of the longest-line program so it will correctly print the length of arbi ...

  5. C - The C Answer (2nd Edition) - Exercise 1-8

    /* Write a program to count blanks, tabs, and newlines. */ #include <stdio.h> /* count blanks, ...

  6. C - The C Answer (2nd Edition) - Exercise 1-15

    /* Rewrite the temperature conversion program of Section 1.2 to use a function for conversion. */ #i ...

  7. C - The C Answer (2nd Edition) - Exercise 1-12

    /* Write a program that prints its input one word per line. */ #include <stdio.h> #define IN 1 ...

  8. C - The C Answer (2nd Edition) - Exercise 1-4

    /* Write a program to print the corresponding Celsius to Fahrenheit table. */ #include <stdio.h&g ...

  9. C - The C Answer (2nd Edition) - Exercise 1-6

    /* Verify that the expression getchar() != EOF is 0 or 1. */ #include <stdio.h> main() { int c ...

随机推荐

  1. Java 序列化Serializable详解(附详细例子)

    Java 序列化Serializable详解(附详细例子) 1.什么是序列化和反序列化Serialization(序列化)是一种将对象以一连串的字节描述的过程:反序列化deserialization是 ...

  2. [Luogu] P4910 帕秋莉的手环

    题目背景 帕秋莉是蕾米莉亚很早结识的朋友,现在住在红魔馆地下的大图书馆里.不仅擅长许多魔法,还每天都会开发出新的魔法.只是身体比较弱,因为哮喘,会在咏唱符卡时遇到麻烦. 她所用的属性魔法,主要是生命和 ...

  3. 启发式合并CSU - 1811

    F - Tree Intersection CSU - 1811 Bobo has a tree with n vertices numbered by 1,2,…,n and (n-1) edges ...

  4. 每日命令:(12)sar

    sar(System Activity Reporter系统活动情况报告)是目前 Linux 上最为全面的系统性能分析工具之一,可以从多方面对系统的活动进行报告, 包括:文件的读写情况.系统调用的使用 ...

  5. web 学习

    重要得之前的知识浏览器 shell 内核外表 内心 IE tridentFirefox Geckogoogle chrome webkit/blinksafari webkitopera presto ...

  6. 转载:Django之form表单

    转载: 一.使用form类创建一个表单 先定义好一个RegForm类: forms.py from django import forms # 导入forms类 class NameForm(form ...

  7. VS2017 + Qt5 + OpenCV400 环境配置

    首先为VS2017 IDE点赞. 配置核心 配置 Qt5 和 OpenCV400,最主要的就是头文件路径.库路径以及库文件名字. 配置方法和步骤 新建一个工程,或者打开一个已有的工程: 选择 View ...

  8. 集训第四周(高效算法设计)J题 (中途相遇法)

    Description   The SUM problem can be formulated as follows: given four lists A, B, C, D<tex2html_ ...

  9. 24L01-2.4G无线传输模块调节记录

    在调试24L01的时候,虽然能用到别人的程序,但仅仅是程序的初始化,并没有告诉我们如何去后续的操作,如何去再次发送一组数.最近调试24L01接近尾声,将逐一的地方总结下来,以便以后查阅,也供其他人借鉴 ...

  10. use-gulp

    参考: https://github.com/Platform-CUF/use-gulp use-gulp 为什么使用gulp? 首先看一篇文章 Gulp的目标是取代Grunt 根据gulp的文档,它 ...