![](https://csdnimg.cn/release/download_crawler_static/86367595/bg5.jpg)
1. 实验结果
✓ 结果如下:
n=8,e=2.718279
请按任意键继续. . .
4. 实验结论
通过本次实验,掌握如下知识点:
✓ 在循环语句中要有使其终止的语句,否则将会限入死循环;
✓ 当循环体有多条语句时,应该用花括号将所有循环体的语句括起来,否则只执行第
一条语句;
✓ 能够分析:循环体执行了多少次?循环结束后,i 的值是多少?
5.2 理论题
A 类
一、填空题
1. 请写出 float x 与“零值”比较的 if 语句 。
2. 当 m=2,n=1,a=1,b=2,c=3 时,执行完 d=(m=a!=b)&&(n=b>c)后,n 的值为 ,
m 的值为 。
3. 分析下述程序的运行结果 。
int main(void)
{
char x='B';
switch(x)
{
case 'A': printf("It is A.\n");
case 'B': printf("It is B.\n");
case 'C': printf("It is C.\n");
default: printf("other.\n");
}
system("pause");
return 0;
}
4. 分析以下程序, 写出程序的运行结果 。