二级C语言程序设计教程课后习题答案(高教版)

上传人:pu****.1 文档编号:563621974 上传时间:2023-06-15 格式:DOC 页数:30 大小:158KB
返回 下载 相关 举报
二级C语言程序设计教程课后习题答案(高教版)_第1页
第1页 / 共30页
二级C语言程序设计教程课后习题答案(高教版)_第2页
第2页 / 共30页
二级C语言程序设计教程课后习题答案(高教版)_第3页
第3页 / 共30页
二级C语言程序设计教程课后习题答案(高教版)_第4页
第4页 / 共30页
二级C语言程序设计教程课后习题答案(高教版)_第5页
第5页 / 共30页
点击查看更多>>
资源描述

《二级C语言程序设计教程课后习题答案(高教版)》由会员分享,可在线阅读,更多相关《二级C语言程序设计教程课后习题答案(高教版)(30页珍藏版)》请在金锄头文库上搜索。

1、二级C语言程序设计教程课后习题答案(高教版)发表日期:2006年3月3日 已经有4929位读者读过此文第一章【1-1】.exe【1-2】.c .obj .exe 【1-3】顺序,分枝(选择),循环第二章【2-1】B 【2-2】D【2-3】B【2-4】A【2-5】C【2-6】A【2-7】B【2-8】B【2-9】A【2-10】C【2-11】B【2-12】B【2-13】A【2-14】11,12【2-15】4.2,4.2【2-16】,定义说明,执行语句【2-17】关键字,用户标识符【2-18】int,float,double【2-19】float a=b=1; 【2-20】存贮单元【2-21】3.5【

2、2-22】a*b/c,a/c*b,b/c*a【2-23】把10赋予变量s【2-24】bit,0/1【2-25】8,127,01111111,-128,10000000(补码) 【2-26】32767,-32768,1111111111111111,1000000000000000【2-27】8,10,16【2-28-1】(错误)#include stdio.h;main() / * main function * / float r,s; /*/*r is radius*/,/* s is area of circular */*/ r=5.0; s=3.14159*r*r; printf(%

3、fn,s)【2-28-2】(正确)#include stdio.h;main() /* main function */ float r,s; /* r is radius, s is area of circular */ r=5.0; s=3.14159*r*r; printf(%fn,s); 【2-29-1】(错误)#include stdio.hmain /* main function */ float a,b,c,v; /* a,b,c are sides, v is volume of cube */ a=2.0; b=3.0; c=4.0 v=a*b*c; printf(%fn

4、,v)【2-29-2】(正确)#include main() /* main function */ float a,b,c,v; /* a,b,c are sides, v is volume of cube */ a=2.0; b=3.0; c=4.0; v=a*b*c; printf(%fn,v);第三章【3-1】C 【3-2】C 【3-3】D 【3-4】C 【3-5】D 【3-6】B 【3-7】C 【3-8】D 【3-9】A 【3-10】B 【3-11】C 【3-12】D 【3-13】D【3-14】C 【3-15】C 【3-16】C 【3-17】C 【3-18】A 【3-19】C【3-

5、20】B 【3-21】(1)-200 2500(2)i=-200, j=2500(3)i=-200/(换行)j=2500【3-22】12,0,0【3-23】一条语句,;【3-24】; 【3-25】100 25.81 1.89234,100/25.81/1.89234,100/25.81 1.89234【3-26】x=127,x= 127,x= 177,x= 7f,x= 127【3-27】x=127,x=127 ,x=$127 ,x=$000127,x=%06d【3-28】a=513.789215,a= 513.79,a= 513.78921500,a= 513.78921500【3-29-1】

6、(错误)main double a,b,c,s,v; printf(input a,b,c:n); scanf(%d %d %d,a,b,c); s=a*b; v=a*b*c; printf(%d %d %d,a,b,c); printf(s=%fn,s,v=%dn,v);【3-29-2】(正确)main() float a,b,c,s,v; printf(input a,b,c:); scanf(%f %f %f:,&a,&b,&c); s=a*b; v=a*b*c; printf(a=%f,b=%f,c=%fn,a,b,c); printf(s=%f,v=%fn,s,v);【3-30】ma

7、in() int h,m; h=560/60; m=560%60; printf(%dh:%dm,h,m); getch();【3-31】main() int m,n; printf(input m & n:); scanf(%d%d,&m,&n); printf(n%d,%dn,m/n,m%n); getch();【3-32】main() double x,y,z,s; printf(input x,y,z: ); scanf(%lf%lf%lf,&x,&y,&z); s=(x+y+z)/3.0; printf(nAverage=%6.1lfn,s); getch();【3-33】main(

8、) int a,b,c,t; printf(Input a,b,c: ); scanf(%d%d%d,&a,&b,&c); t=c; c=b; b=a; a=t; printf(na,b,c=%d,%d,%dn,a,b,c); getch();第四章【4-1】A【4-2】A【4-3】A【4-4】D【4-5】C【4-6】A【4-7】B【4-8】A【4-9】D【4-10】A【4-11】非零,零【4-12】,= =,!=【4-13】!,&,| 【4-14】!,关系运算符,&,| 【4-15】! 【4-16】(A)a=b|a4【4-17】1【4-18】xm0)|(m1=m0)&(d1=d0) age=

9、y1-y0; else age=y1-y0-1; printf(nThe student age is %d,age); getch();【4-23】main() int m; printf(ninput a integer: ); scanf(%d,&m); if (m%2=0) printf(n%d is event.,m); else printf(n%d is ord.,m); getch();【4-24】main() int a,b,c,max; printf(ninput a,b,c: ); scanf(%d%d%d,&a,&b,&c); max=a; if (bmax) max=

10、b; if (cmax) max=c; printf(max is %d,max); getch();【4-25-1】main() int x,y; printf(ninput x: ); scanf(%d,&x); if(x-5)&(x0)&(x-5)&(x10) if (x0) y=x+1; printf(nx is %d , y is %d,x,y); else printf(input x is error ! %c,007); getch();【4-25-3】main() int x,y; printf(ninput x: ); scanf(%d,&x); if (x-5)&(x0)

11、&(x10) y=x+1; printf(nx is %d , y is %d,x,y); getch();【4-25-4】main() int x,y; printf(ninput x: ); scanf(%d,&x); switch(x) case -4: case -3: case -2: case -1: y=x;break; case 0 : y=x-1;break; case 1 : case 2 : case 3 : case 4 : case 5 : case 6 : case 7 : case 8 : case 9 : y=x+1;break; default : printf(Input x error ! %c,7); printf(nx is %d , y is %d,x,y); getch();第五章【5-1】D【5-2】C【5-3】B【5-4】C【

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 习题/试题

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号