第1章习题 一、选择题
1、A 2、D 3、C 4、D 5、B 6、C 7、C 8、B 9、B 10、A
二、填空题
1、一,函数体
2、main(主),main(主)
3、编译,目标
4、.c,.obj,.exe
5、缩进,无影响,/* */
三、程序分析题 1、
*****************
Very good!
***************** 2、
a=12,b=5
a=17,b=22 3、
r= 5.50,s=95.033098
四、编程题
1.用printf()函数在屏幕上输出自己的班级、学号、姓名。
#include\
void main() {
printf(\班级:BX1109\\n\
printf(\学号:111003530901\\n\
printf(\姓名:王孟荣\\n\ }
2.从键盘输入两个整数,计算它们的和、差、积、商,并在屏幕上输出结果。
#include
void main() {
int x,y,a,b,c;
float d;
printf(\
scanf(\
a=x+y;
b=x-y;
c=x*y;
d=1.0*x/y;
printf(\ }
第2章习题 一、选择题
1~5 BCDCD
6~10 DBBCA
二、填空题
1.单精度浮点型、双精度浮点型、字符型 2.0
3.x*10+x/10
4.5.5
5.5.7 20
6.sin(sqrt(x*x))/(a*b)
7.,
8.1111011 173 7B
9.3 3
10.3
三、程序分析题
1. 7,8,10
2. 1,3
3. 5 F
4. (int)i=12, 12.50
5. 4 61 57 9 112
四、编程题
1.编写程序,求表达式c=21%9-(float)a+4/b*b的值,假设表达式中a和b的值分别由键盘输入。
#include
void main( ) {
int a,b;
float c;
printf(\
scanf(\
c=21%9-(float)a+4/b*b;
printf(\ }
2. 编写程序,从键盘输入两个整数存入变量a和b中,求a2-b2的值并输出。
#include
void main( ) {
int a,b,c;
printf(\
scanf(\
c=a*a-b*b;
printf(\ }
第3章习题 一、选择题 1 2 3 4 5 6 7 8 9 10 D