发布时间 : 星期日 文章河南科技大学C语言试题更新完毕开始阅读
C程序的运行环境和简单C源程序的调试,实验报告(共 题),用时(127分33秒),成绩(A)
1、 有如下程序: #include\ main( ) { int a=8;
printf(\ printf(\ }
第二个printf语句的运行结果是_______________。
你的答案:8,10,8,8 √
2、 有如下程序: #include\ main( )
{ char c1='a',c2='b'; int a=97,b=98; printf(\ printf(\ }
最后一个printf语句的运行结果是_______________。
你的答案:a,b √
3、 有如下程序: #include\ main( )
{ int i,j; i=3; j=4;
printf(\ %d\\n\ printf(\
printf(\}
最后一个printf语句的运行结果是_______________。
你的答案:-4,-6 √
4、 有如下程序: #include\main( ) { int a=7;
float x=2.5,y=4.7,z;
z= x + a % 3 * (int) (x + y) % 2 / 4; printf(\
程序的运行结果是______________。 你的答案:2.500000 √
思考题分数:60分,源代码分数:40分。应提交源代码:5个,实际提交源代码:5个。
Copyright ? 2006 All rights reserved 河南科技大学 建议使用:800×600以上分辨率IE4.0以上版本浏览器
顺序结构程序设计,实验报告(共 题),用时(48分21秒),成绩(A)
1、 从键盘上输入:32 18
printf(\ scanf(\ printf(\ }
你的答案:i=32,j=18 √
2、 如果下面程序运行结果是i=12.5,j=-4.0,从键盘应输入:_______________。 #include\ main( )
{ float i,j;
scanf(\ printf(\ }
你的答案:i=12.5,j=-4.0 √
3、 输入一个大写字母A,将它转换为小写字母a,输出小写字母a及对应的ASCII值97。 要求输出格式为:j=a,j=97。输出语句应为________________。 #include\
main( )
{ char i,j;
scanf(\ j=i+32; 输出语句; }
你的答案:printf(\ √
4、 将a,b两个变量的值交换后,要求按“a=2,b=1”格式输出。 划线处应当填写:__________________。 #include\ main( )
{ int a=1,b=2,t; t=a; a=b; b=t;
______________ ; }
你的答案:printf(\ √
思考题分数:60分,源代码分数:40分。应提交源代码:5个,实际提交源代码:5个。
Copyright ? 2006 All rights reserved 河南科技大学 建议使用:800×600以上分辨率IE4.0以上版本浏览器
选择结构程序设计,实验报告(共 题),用时(84分39秒),成绩(A)
1、 下面程序的功能是实现表达式z=( x>=y ? x : y),请将程序填写完整。 #include\ main( ) { int x, y, z;
printf(\ scanf(\ if (______) z=x; else z=y;
printf(\ }
你的答案:x>=y √
2、 下面程序的运行结果为_______________。 #include\main( )
{ int a=3,b=5,c=8;
if(a++<3 && c--!=0) b=b+1;
printf(\}
你的答案:a=4,b=5,c=8 √
3、 程序填空,从键盘上输入x的值,按下式计算y的值。 ┌ x x<1 y= ┤ 2x-1 1≤x<10 └ 3x-11 x≥10 #include \main( ) { float x,y;
printf(\ scanf(\
if ( ________ ) y=x; else if( x<10&&x>=1 ) y=2*x-1; else
y=3*x-11;
printf(\ }
你的答案:x<1 √
4、 下面程序运行时从键盘上输入15,20,运行结果为_______________。 #include \main( ) { int a,b,t; t = 0;
scanf(\ if (a>b) t = a ; a = b ; b = t ;