1 / 6
文档名称:

大连东软信息学院大一上 电子工程 c语言-实验_第三次,第六周.doc

格式:doc   大小:109KB   页数:6
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

大连东软信息学院大一上 电子工程 c语言-实验_第三次,第六周.doc

上传人:63229029 2017/2/5 文件大小:109 KB

下载得到文件列表

大连东软信息学院大一上 电子工程 c语言-实验_第三次,第六周.doc

文档介绍

文档介绍:Lab 3 Conditions OBJECTIVES pleting this experiment, you will be able to: ?U se expressions and conditional operators ? Use logic operators ?U se if structure and if-else structure ? Use switch structure PROCEDURES PART 1 Understanding the difference between character and interger(include Decimal, Octal and Hexdecimal). /*Write down the display result through reading program, then verify byrun this program. */ 1. #include <> void main() { char ch=0x31; printf("%d\n",ch); /* ____49_______*/ printf("%o\n",ch); /* _____61_______*/ printf("%x\n",ch) /* _____31_______*/ printf("%c\n",ch); /* _____1_______*/ }2. #include <> void main() { int ch= 65; printf("%d\n",ch); /* _____65______*/ printf("%o\n",ch); /* ______101______*/ printf("%x\n",ch) /* _______41_____*/ printf("%c\n",ch); /* ________A____*/ } S ummarize the features of character and integer in your words. —————————————————— PART 2 If Structure. This program implement the following function: find out which one is biggest among a,b and upplement the blank with aorborc. A. if(a>b && a>c) max=___ a _____ else if(b>c) max=____ b ____ else max=___ c _____ B. if (a>b) if(a>c) max=____ a __ else max=__ c ____ else if(b>c) max=___ b _____ else max=___ c ______ Please input the value of a,b,and c through keyboard ,output the maxvalue .Supplement the two parts of program asa whole C program,pile and run it in Tu