编写程序(Programming).doc

  1. 1、本文档共8页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 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

您可能关注的文档

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档