
买验3 实验目的 熟悉使用if、 switch语句编程. 实验题目 由键盘输入任意三个数,按从大到小输出此 三个数。 2、设计一个判断输入年份是否为闰年的C程序。 3、根据输入的1~7的数字输出今天是星期几?
实验3 一、实验目的 熟悉使用if、switch 语句编程. 二、实验题目 1、由键盘输入任意三个数,按从大到小输出此 三个数。 2、设计一个判断输入年份是否为闰年的C程序。 3、根据输入的1~7的数字输出今天是星期几?

实验3 、熟悉BC编辑环境 1、通过 watch窗口查看程序中变量的值是如何变化的 ■X File Edit Search Run Com -4:部 Project Options Window I阳elp tinc lude Size/Move Ctrl+F5 void main( Zoom F5 arcade t i,n i Tile float s, sum. ave Next Close Alt sum=0; Close all i=1 Message printf(" please input the number of students: ">:Outnut canf( zd".&n) latch while (i
三、熟悉BC编辑环境 1、通过watch窗口查看程序中变量的值是如何变化的 实验3

买验3 出现 watch窗口 BC File Edit Search Run Compile Debug Project Options Window He lp #include void main ( float s, sum. ave sum=0: i=1; printf scanf( yd",&n) while(i
实验3 出现watch窗口

实 应3 在 watch中添加想查看的变量,按“ Insert”键,将弹出 一个“ add watch”窗口 A BC File Edit Search Run Compile Debug Project Options Window Hely 排 inc lude
实验3 在watch中添加想查看的变量,按“Insert”键,将弹出 一个“add watch”窗口 输入想查看的变量的名字

买验3 BC File Edit Search Run Compile De bug Project Options Window He lp finc lude void main float s, sum ave i sum=0; i=1 printf(" please input the number of students: ) scanf(d.&n) while (i
实验3 可以继续按“Insert”键,加入其他的变量

买验3 BC File Edit Search Run Compile Debug Project Options Window He E6-4. CPP printf(" please input the number of students: ">i scanf( d",&n) scanf("f,&s); sum=sum+s j ave=sum/n i printf( ave=6.2f\n", ave); getch) 17:68=1 sum: Undefined symbol 'sum sum: Undefined symbo sum 1: Undefined symbol 'i .s: Undefined symbols i: Undefined symbol 'i S: Undefined symbol‘s F1 Help F2 Save F3 Open Alt-F9 Compile F9 Make F10 Menu
sum: Undefined symbol ‘sum’ i: Undefined symbol ‘i’ s: Undefined symbol ‘s’ 实验3

实验3 2、单步运行程序:按“F8”,每按一次就执行一条语句 File Edit Search Run Compile Debug Pro ject Options Window H Winc ludestdio. h> Run Ctrl+F9 #inc lude Program reset Ctrl+F2 void main ( Go to cursor F Trace into int i Step over F8 float s, sum, ave i HrgumeIIcs. sum=g i=1 printf(" please input the number of students: > scanf( zd.&n) while (i
2、单步运行程序: 按“F8” , 每按一次就执行一条语句 实验3

买验3 第一次按“F8”开始从main函数开始执行程序 BC 凹X File Edit Search Run Compile De bug Project Options Window He E6-4 Winc lude
实验3 第一次按“F8”开始从main函数开始执行程序 sum: Undefined symbol ‘sum’ i: Undefined symbol ‘i’ s: Undefined symbol ‘s’

实验3 ile Edit Search Run Compile Debug Project Options W lindow E6-4. CPP inc lude void main( It i,n j float s, sum, ave i sum=0; printf(" please input the number of students: > scanf( nd",&n); while (i
实验3 sum: 7.447932e-35 i: 1716 s: 0.0

实验3 BC 口x File Edit Search Run Compile De bug Project Options Window He E6-4.C Include 排 inc lude
实验3 sum: 0.0 i: 1716 s: 0.0