昆明理工大学C复习资料.docVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
昆明理工大学C复习资料

复习资料 C语言基础 基本内容 数据类型 常量 变量 表达式 运算符 格式化输入与输出 注释及语句 数据类型 是根据各种数据所占存储单元大小不同而划分了不同的数据类型。C语言中的数据类型有基本类型、构造类型和指针类型。 各种类型数据由于所占单元大小不同,故其所表示的范围也不一样。 1)int, char, float, double are all basic data types in C language. (对) 2)Provided that the length of int is 16 bits, then the value scope of unsigned int is:(B) A.0~255 B.0~65535 C.-32768~32767 D.-256~255 3)The declaration is: int k=0,a=0,b=0; unsigned long w=5; double x=1.42,y=0; then the incorrect expression is_A__ A.y=x%3 B. w+= -2 C. x=w+5 D. k*=a+b 4) In C, basic data types are int, char, float and _double_____. 5) Given declaration: char c=’\035’; the size of c is __1____bytes. 混合数据类型的运算 1)Suppose declaration: char a=’c’; then statement: printf(“%d”,a); is wrong.(错) 2)Suppose declaration: int a; float x,y; then the result data type of expression: x+a%3*(int)(x+y)%2/4 is _float_____. 3)The data type of expression: 18/4*sqrt(4.0) is float. (错) 字符的ASCII值及其合理应用 1)Suppose declaration: char a; then expression: ch=’5+9’ is correct.(错) 2) ASCII of ‘A’ is 65.then read the following programand the result of it. Fill the blanks: main() { char a; a=’A’+__11____; printf(“%c”,a); } result: L 3) To get a character with getchar(), you can input corresponding ASCII number of the desired character from keybord.(错) 表达式类型 Suppose declaration: int a; float f; double i; then the result data type of expression: 10+’a’+i*f is __double____. 常量 在程序运行过程中,其值不能被改变的量称为常量,常量区分为不同的类型。常量一般从其字面形式即可判别,也可以用一个标识符代表一个常量。 字符常量的定义形式: #define PRICE 30 字符常量定义后,在程序中不能再改变其值,如PRICE++是错误的。 Incorrect string constant is: (A) 字符串常量 A. ‘abc’ B. “1212” C. “0” D. “ ” 2)If Rate is a symbol constant, we can use it as Rate++. (错) 变量 其值可以改变的量称为变量。一个变量应该有一个名字,在内存中占据一定的存储单元,在该存储单元中存放变量的值。 变量与声明:变量命名规则,大小写敏感 1) As variable name, tmpvar and TmpVar are same. (错) 2) Keywords can be used as variable names. (错) 3)The first character of variable name must be a letter or a underscore (_). (对) 4)W

文档评论(0)

xy88118 + 关注
实名认证
文档贡献者

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

1亿VIP精品文档

相关文档