/*
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. Discuz!代码

    我如何使用Discuz!代码   Discuz!代码 效果 [b]粗体文字 Abc[/b] 粗体文字 Abc [i]斜体文字 Abc[/i] 斜体文字 Abc [u]下划线文字 Abc[/u] 下划线 ...

  2. PHP生成文档,并把数据加入文档的小案例

    PHP生成文档,可以利用file_put_contents($filename, $data),其中$filename表示文档名,$data表示需要放入的数据, 若存放的是数组,这还需要使用seria ...

  3. formatDate() 格式化日期

    function datefmt(milSec, format) { var oldTime = Number(milSec); //得到毫秒数 // 日期格式转换 var t = new Date( ...

  4. linux 服务脚本

    #!/bin/bash # # chkconfig: # description: my_SERVICE_NAME is a my Service # # common function . /etc ...

  5. CSS 全局样式

    设置全局 CSS 样式:基本的 HTML 元素均可以通过 class 设置样式并得到增强效果:还有先进的栅格系统.

  6. 开发基本的php框架

    github路径:https://github.com/zhengchuzhou/easyPhpFramework 一.目录结构及用途 二.相关代码: 1.入口文件(index.php): <? ...

  7. mysql数据库导出导入

    MYSQL的命令行模式设置: 我的电脑->属性->高级系统设置->环境变量->系统变量-> 选择Path,在后面添加“;path\mysql\bin;”其中path为MY ...

  8. Python之Pycharm安装及介绍

    在学习Python之前,先安装好编程所需的编译环境也就是IDE,在安装PycharPm之前先安装最新版本的anaconda根据不同的系统选择不同的版本,安装好anaconda以后再安装Pycharm, ...

  9. 集训第五周动态规划 J题 括号匹配

    Description We give the following inductive definition of a “regular brackets” sequence: the empty s ...

  10. javaWeb学习之 Filter过滤器----https://www.cnblogs.com/xdp-gacl/p/3948353.html

    https://www.cnblogs.com/xdp-gacl/p/3948353.html