博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C - The C Answer (2nd Edition) - Exercise 1-4
阅读量:6949 次
发布时间:2019-06-27

本文共 825 字,大约阅读时间需要 2 分钟。

/*Write a program to print the corresponding Celsius to Fahrenheit table.*/#include 
/* 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.0100 212.0120 248.0140 284.0160 320.0180 356.0200 392.0220 428.0240 464.0260 500.0280 536.0300 572.0Press any key to continue . . .*/

转载地址:http://mehnl.baihongyu.com/

你可能感兴趣的文章
Win10下安装Ubuntu16.04虚拟机并搭建TensorFlow1.3环境
查看>>
leetcode 108. Convert Sorted Array to Binary Search Tree
查看>>
【商城购物车】购物车逻辑
查看>>
PCIE协议解析 synopsys IP loopback 读书笔记(1)
查看>>
关于小程序你需要知道的事
查看>>
表服务器无法打开与报表服务器数据库的连接。所有请求和处理都要求与数据库建立连接...
查看>>
4月第4周业务风控关注 | 网络犯罪经济每年1.5万亿美元 GDP居全球第12位
查看>>
idea中gitlab新创建分支查找不到的原因
查看>>
php调试时echo,print_r(),var_dump()的区别
查看>>
vue 作用域插槽
查看>>
tfs 2013 利用 web deploy 完成asp.net站点自动发布
查看>>
dom对象常用的属性和方法有哪些?
查看>>
C#遍历XmlDocument对象所有节点名称、类型、属性(Attribute)
查看>>
范畴论-一个单子(Monad)说白了不过就是自函子范畴上的一个幺半群而已
查看>>
Spring cloud系列之Zuul配置项中sensitiveHeaders和ignoredHeaders
查看>>
51单片机交通灯(定时器+38译码器+中断)
查看>>
vue 总结
查看>>
深入理解java虚拟机(二):java内存溢出实战
查看>>
31.QPainter-rotate()函数分析-文字旋转不倾斜,图片旋转实现等待
查看>>
直接通过Binder的onTransact完成跨进程通信
查看>>