双语c期末复习资料(2012级-注释)

双语c期末复习资料(2012级-注释)

ID:6569776

大小:120.00 KB

页数:32页

时间:2018-01-18

双语c期末复习资料(2012级-注释)_第1页
双语c期末复习资料(2012级-注释)_第2页
双语c期末复习资料(2012级-注释)_第3页
双语c期末复习资料(2012级-注释)_第4页
双语c期末复习资料(2012级-注释)_第5页
资源描述:

《双语c期末复习资料(2012级-注释)》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、复习概要第一章C语言基础1)int,char,float,doubleareallbasicdatatypesinClanguage.(对)2)Providedthatthelengthofintis16bits,thenthevaluescopeofunsignedintis:(B)A.0~255B.0~65535C.-32768~32767D.-256~2553)Thedeclarationis:intk=0,a=0,b=0; unsignedlongw=5; doublex=1.42,y=0; thentheincorrectexpressionis_A__A.y=

2、x%3B.w+=-2C.x=w+5D.k*=a+b4)InC,basicdatatypesareint,char,floatand_double_____.混合数据类型的运算1)Supposedeclaration:(假设陈述)chara=’c’;thenstatement:printf(“%d”,a);iswrong.(错)2)Supposedeclaration:inta;floatx,y;thentheresultdatatypeofexpression:x+a%3*(int)(x+y)%2/4is_float_____.3)Thedatatypeofexpress

3、ion:18/4*sqrt(4.0)isfloat.(错)字符的ASCII值及其合理应用Supposedeclaration:chara;thenexpression:ch=’5+9’iscorrect.(错) ASCIIof‘A’is65.thenreadthefollowingprogramtheresultofit. Filltheblanks: main() { chara; a=’A’+__4____; printf(“%c”,a); } result:E常量字符常量的定义形式:#definePRICE30字符常量定义后,在程序中不能再改变其值,如PRICE++

4、是错误的。Incorrect(错误的)stringconstantis:(A)字符串常量A.‘abc’B.“1212”C.“0”D.“”2)IfRateisasymbolconstant,wecanuseitasRate++.(错)变量其值可以改变的量称为变量。一个变量应该有一个名字,在内存中占据一定的存储单元,在该存储单元中存放变量的值。变量与声明:1)Asvariablename,tmpvarandTmpVararesame.(错)2)Keywordscanbeusedasvariablenames.(错)3)Thefirst(characterofvariable)

5、(字符变量)namemustbealetteroraunderscore(强调)(_).(对)4)Whichofthefollowingiserror?(A)A.Keywordscanbeusedasvariablenames.B.Wetendtouseshortnamesforlocalvariables,especiallyloopindices,andlongernamesforexternalvariables.C.Uppercaseandlowercaselettersinvariablenamesaredistinct.D.Thefirstcharactero

6、fvariablenamemustbealetteroraunderscore(_).变量赋初值1)Thestatement:intn1=n2=10;iscorrect.(错)2)Thedeclaration:floatf=f+1.1;iscorrect.(错)3)Whichofthefollowingistheillegalvariablenames?(D)A.LadB.n_10C._567D.g#k转义字符的应用1)Supposedeclaration:charc=’101’;thenthecountofcharacterinvariablecis___A__.2)

7、Supposedeclaration:charc=’61’;thenthecountofcharacterinvariablecis___1__.3)Supposedeclaration:charc=’’;thenthecountofcharacterinvariablecis___new-line_.说明:转义字符以开头,nn必须是8进制数。‘102’可以视为一个字符。当变量成为计数器和累加器的时候如何初始化1)Whenweusesumasanaccumulatingoracounting,weshouldf

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。