/*
Write a program to print the corresponding Celsius to Fahrenheit table.
*/ #include <stdio.h> /* print Celsius-Fahrenheit table for celsius = 0, 20, ..., 300; floating-point
version */
main()
{
float fahr, celsius;
int lower, upper, step; lower = 0; /* lower limit of temperature table */
upper = 300; /* upper limit */
step = 20; /* step size */ printf("Celsius Fahr\n");
celsius = lower;
while (celsius <= upper)
{
fahr = (9.0 * celsius) / 5.0 + 32.0;
printf("%3.0f %6.1f\n", celsius, fahr);
celsius += step;
}
} /* Output: Celsius Fahr
0 32.0
20 68.0
40 104.0
60 140.0
80 176.0
100 212.0
120 248.0
140 284.0
160 320.0
180 356.0
200 392.0
220 428.0
240 464.0
260 500.0
280 536.0
300 572.0
Press any key to continue . . . */

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

  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-5

    /* Modify the temperature conversion program to print the table in reverse order, that is, from 300 ...

  7. 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 ...

  8. 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 ...

  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. What is the difference between SET and SELECT when assigning values to variables, in T-SQL?

    http://vyaskn.tripod.com/differences_between_set_and_select.htm https://stackoverflow.com/questions/ ...

  2. thinkphp5项目--个人博客(八)

    thinkphp5项目--个人博客(八) 项目地址 fry404006308/personalBlog: personalBloghttps://github.com/fry404006308/per ...

  3. WebAPI的自动化监控和预警

    Metrics.net + influxdb + grafana 构建WebAPI的自动化监控和预警 前言 这次主要分享通过Metrics.net + influxdb + grafana 构建Web ...

  4. rest_framework-节流-总结完结篇

    列表从后往前读 #1.在request中获取IP#2.访问记录 VISIT_RECORD = {} 放缓存 数据库 都可以 建议缓存import timeclass VisitThrottle(obj ...

  5. ckeidtor编辑器添加图片上传功能

    1.ckeditor默认没有上传图片功能,只能通过Url显示图片,图下图 2.首先说明,ckeditor是有上传功能的,只是隐藏了,需要通过配置让它显示 找到ckeditor/plugins/imag ...

  6. sql点滴

    http://www.cnblogs.com/tylerdonet/p/5509398.html

  7. HDU 2515 Yanghee 的算术【找规律】

    题意:中文的题目 找规律可以发现 sum[1]=a[1]+a[2] sum[2]=a[1]+a[3] sum[n]=a[2]+a[3] 解出a[1],就可以求出其他的了 #include<ios ...

  8. Android chromium 1

    For Developers‎ > ‎Design Documents‎ > ‎ Java Resources on Android Overview Chrome for Android ...

  9. DedeCMS筛选简单实现方法不改后台源文件

    笔者在前面几篇文章中提到的dedecms筛选的实现方法,对新手来说实现过程较复杂.接下来分享一个最简单的实现在移动端上筛选功能. 最近在筹备移动端企业站,实现功能有:实现一个管理后台管理PC端和移动端 ...

  10. NodeJS学习笔记 (21)事件机制-events(ok)

    模块概览 events模块是node的核心模块之一,几乎所有常用的node模块都继承了events模块,比如http.fs等. 模块本身非常简单,API虽然也不少,但常用的就那么几个,这里举几个简单例 ...