/*
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. VS2008 ActiveX(ocx控件)的调试工具ActiveX Control Test Container安装说明

    vs2008中的TSTCON( ActiveX Control Test Container )工具非自动安装,而是作为一个例程提供.所以应找到该例程,并编译: 如vs2008安装在默认路径则 1, ...

  2. 解决【npm ERR! Unexpected end of JSON input while parsing near '...sh_time":141072930277'】方案

    问题描述执行npm install的时候报错npm ERR! Unexpected end of JSON input while parsing near '...sh_time":141 ...

  3. vue之package.json文件解析

    1.package.json是什么? 什么是Node.js的模块(Module)?在Node.js中,模块是一个库或框架,也是一个Node.js项目.Node.js项目遵循模块化的架构,当我们创建了一 ...

  4. JAVA基础——对象流

    对象的输入输出流的作用: 用于写入对象 的信息和读取对象的信息. 使得对象持久化.    ObjectInputStream   : 对象输入流    ObjectOutPutStream  :对象输 ...

  5. CentOS7.4 搭建和使用telnet

    1.先检查是否安装了telnet rpm -qa | grep telnet  //检查你的CentOS是否安装了telnet和telnet-server rpm -qa xinetd //检查你的C ...

  6. 源码学习-Object类

    1.Object类是Java所有类的超类 2.查看Object的属性和方法,发现Object类没有属性,只有13个方法,其中7个本地方法. 3.接下来看具体的方法 3.1 Object() 默认的构造 ...

  7. Tensor数据类型

    目录 Tensor数据类型 属性 数据类型判断 数据类型转换  tensor转numpy Tensor数据类型 list: [1,1.2,'hello'] ,存储图片占用内存非常大 np.array, ...

  8. Python和Java的语法对比,语法简洁上python的确完美胜出

    Python是一种广泛使用的解释型.高级编程.通用型编程语言,由吉多·范罗苏姆创造,第一版发布于1991年.可以视之为一种改良(加入一些其他编程语言的优点,如面向对象)的LISP.Python的设计哲 ...

  9. Selenium打开谷歌浏览器提示chromedriver.exe停止运行且浏览器显示请关闭开发者模式

    提示关闭开发者模式,其实是chromedriver.exe与chrome 浏览器版本不一致导致的, 查看浏览器版本方法  在浏览框输入,chrome://version/. 显示是 Google Ch ...

  10. Jupyter notebook使用笔记

    常用快捷键 For a Cell,   Blue -> selecting. Green -> editing. Esc -> exist edit When the cell is ...