- 1、本文档共8页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
编写程序(Programming)
编写程序(Programming)
The previous sections describe concepts of constants and variables, operators, expressions, and statements, and give a general idea of their use. Maybe someone who has just learnt the program will feel a little boring, and here we are going to write the first C language program.
#define PI 3.1416
(main)
{
Float, Radius, Area;
Scanf (%f, Radius); / * input radius value
Area=PI*Radius*Radius;
Printf (%f\n, Area); / * output round area
}
1. a C language program, usually starting from the preprocessor statement with # no.. As for preprocessing, we will introduce later, #define PI 3.1415926 here is equivalent to PI, representing 3.1416. The following PI is encountered in the program, so we will replace it with 3.1416. In future programs, we will not use preprocessing statements before we can learn the preprocessing.
2.main () any one complete program needs main (), which is a function, what exactly is a function, will be told later, and here youll have to remember. On the back there is a {} all statements included in it, that those statements belong to main (). The program starts from the left curly brace.
3.{} inside the 4 lines of sentences, we should all understand, first define two variables, a representative radius, a representative area, and then enter the value of the radius, and then the area, and finally on the screen output area. (main) program to altmode the end {}. A sentence Area=PI*Radius*Radius for an area; equivalent to Area=3.1416*Radius*Radius; (completely replaces PI with 3.1416).
Specific procedures from the preparation to the operation of the results of the steps for:
1. double click tc.exe to enter the Turbo C 2 compile interface
2.ALT+E enters edit mode
3. writing program
4.F2 storage program (also enter the File menu, select save), the first storage needs to write the program name (*.C), carriage return
5.ALT+F9 compile, if there are errors and warnings, the cursor stays in the wrong line, carriage return is modified, and then re
您可能关注的文档
- 给你的电脑加速(Speed up your computer).doc
- 给准妈妈的有益实用大肚经(A useful and practical exercise for expectant mothers).doc
- 给初学编程者的话(For beginner programmers).doc
- 细木工板制作基本知识(Basic knowledge of blockboard production).doc
- 给咨询员新人的点滴建议(Give advice to the consultant).doc
- 结构设计标准(Structural design standard).doc
- 给婴儿买衣服要注意事项!(Attention should be paid to buying clothes for the baby!).doc
- 给宝宝吃水果的学问(Knowledge of eating fruit for the baby).doc
- 经纬度与3度带,6度带的概念及其转换方法(The concept of latitude and longitude and 3 degree belts and 6 degrees belts and their conversion methods).doc
- 给力流行语(Awesome buzzwords).doc
- 2024-2030年超声波探头医疗行业市场现状供需分析及投资评估规划分析研究报告.docx
- 2024-2030年起重运输设备行业发展分析及发展趋势与投资前景预测研究报告.docx
- 2024-2030年通航培训产业市场深度分析及前景趋势与投资研究报告.docx
- 2024-2030年通信卡项目可行性研究报告.docx
- 2024-2030年车辆对讲系统(VIS)行业市场现状供需分析及重点企业投资评估规划分析研究报告.docx
- 2024-2030年车载空气净化器行业市场现状供需分析及重点企业投资评估规划分析研究报告.docx
- 2024-2030年课后服务行业市场深度调研及发展趋势和投资前景预测研究报告.docx
- 2024-2030年质押贷款项目可行性研究报告.docx
- 2024-2030年轴环行业市场现状供需分析及投资评估规划分析研究报告.docx
- 2024-2030年调味品行业市场发展分析及前景趋势与投资研究报告.docx
文档评论(0)