C - The C Answer (2nd Edition) - Exercise 1-5
/*
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的更多相关文章
- C - The C Answer (2nd Edition) - Exercise 1-7
/* Write a program to print the value of EOF. */ #include <stdio.h> main() { printf("EOF ...
- 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 ...
- C - The C Answer (2nd Edition) - Exercise 1-1
/* Run the "hello, world" program on your system. Experiment with leaving out parts of the ...
- 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 ...
- C - The C Answer (2nd Edition) - Exercise 1-8
/* Write a program to count blanks, tabs, and newlines. */ #include <stdio.h> /* count blanks, ...
- 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 ...
- 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 ...
- C - The C Answer (2nd Edition) - Exercise 1-4
/* Write a program to print the corresponding Celsius to Fahrenheit table. */ #include <stdio.h&g ...
- 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 ...
随机推荐
- 使用GetLogicalDriveStrings获取卷标
#include <windows.h> #include <stdio.h> #define BUFSIZE 512 int main() { TCHAR szTemp[BU ...
- TCP/IP 协议分层
协议分层 可能大家对OSI七层模型并不陌生,它将网络协议很细致地从逻辑上分为了7层.但是实际运用中并不是按七层模型,一般大家都只使用5层模型.如下: 物理层:一般包括物理媒介,电信号,光信号等,主要对 ...
- Spring Cloud和Dubbo的对比
- How To: IDENTIFY THE ASM DEVICE FROM ASMLIB
使用oracleasm querydisk可以查询到device的major和minor,从而对应. for i in `oracleasm listdisks` do oracleasm query ...
- lnmp -memcached使用
系统需求: CentOS/RHEL/Fedora/Debian/Ubuntu/Raspbian/Deepin Server/Aliyun/Amazon/Mint Linux发行版 需要5GB以上硬盘剩 ...
- js 弹幕效果
<!DOCTYPE HTML><html><head><meta charset="utf-8"><title>弹幕&l ...
- 4.model 字段
一.字段名 字段名 类型 参数 AutoField(Field) - int自增列, 必须填入参数 primary_key=True BigAutoField(AutoField) - bigint自 ...
- MQL5备忘(2016-8-28)
MQL5备忘 快捷操作: ·Ctrl+Space------The List Names dropdown ·Ctrl+Shift+Space------Show Parameter Info 整数类 ...
- 84-Market Facilitation Index 市场促进指数指标.(2015.7.3)
Market Facilitation Index 市场促进指数指标 MFI指标的计算方式为: MFI=High(最高价)-Low(最低价))/ Volume(成交量) MFI上升,成交量上升,表示价 ...
- jz2440烧写方法笔记
1,jz2440用dnw烧写普通程序的步骤是: ①选择将uboot烧写到nor flash或者是nand flash中 ②打开dnw,选择要烧写的程序,注意不是uboot,是你要烧写的程序,他将所有的 ...