关键词不能为空

当前您在: 主页 > 英语 >

浙江大学c程2006A试卷E

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-02-09 22:14
tags:

-

2021年2月9日发(作者:drawable)


浙江大学


2006-2007


学年冬季学期



《程序设计基础及实验》课程期末考试试卷(

A




开课学院:计算机学院


,


考试形式:闭卷



考试时间:


2007



1



24



,


所需时间:


120


分钟,任课教师



考生姓名:



学号:



专业:


(


注意:答题内容必须写在答题卷上,写在本试题卷上无效


)



Section 1: Single Choice



2 mark for each item, total 20 marks




1.


According to the declaration: int x=23; the value of expression (x++*1/3) is



______.


A



7


B



8


C



15


D



16


2.


According to the declaration: int a=12; the value of expression a+=a- =a*=a is ______.


A



-120


B



144


C



0


D



-132


3.


According to the declaration: int a=10, b=20; the value of expression !a


A



1


B



0


C



10


D



20


4.


According to the declaration: int a; the value of expression (a&3)==(a%4) is _____.


A



0


B



1


C



uncertain


D



expression error


5.


The following code fragment prints out _____.



for(a=1,i=-1;-1<=i<1;i++)




{ a++; printf(“%2d”,a);



}



printf(“%2d”,i);



A



2


B



-1


C



0


D



3


6.


The following code fragment prints out _____.



char c[]=“I


tr0will


n”;




printf(“%d”,strlen(c));



A



4


B



15



C



16


D



11


7.


The following code fragment prints out _____.



int a=2,b=9;



do{ b-=a; a++; }while(b--<0);



p rintf(“a=%d,b=%d



n”,a,b);



A



a=1,b=-1


B



a=2,b=8


C



a=3,b=6


D



a=4,b=9


8.


The


following


code


fragment


outputs


the


string


str.


The


loop


condition


str[i]!=?



0?


can


be


replaced by _______.


char str[80]=”hello, world”;



f


or (i = 0; str[i] != ?



0?; i++)



putchar(str[i]);



C Programming



TEST PAPER, Jan 24, 2007






















































1 / 10


A



str[i]


B



i < 80


C



!(str[i] = ?



0?)



D



i <= 80


9.


With


regard


to


the


array


definition


“int


a[4];




which


expression


in


the


follows


is


wrong


_______?


A



*a


B



a[0]


C



a


D



a++


10.


The following statements have defined different arrays. Which statement is wrong _______?


A



int a[1][3];


B



int x[2][2]={1,2,3,4};



C



int x[2][]={1,2,4,6};



D



int m[][3]={1,2,3,4,5,6};



Section 2: Fill in the blanks



2 mark for each item, total 30 marks




1.


2.


3.


4.


The value of expression !!2007 is ___


1


__.


The value of expression 10>5>1 is __


0


___.


The value of expression



sizeof(“%%hel lo


nworld


n”)



is___


15


__.


The following code fragment prints out __


020


___.


printf(


5.


Assume that a=0



b=3



c=0



d=26. After running the following code fragment, the value of d


is __


26


___.



if(!b) d=d-10;



else if(a)



if(!c) x=15;



else x=25;


6.


The following code fragment prints out __


*2*#*3*#


___.


char x='0',y='1';


switch(!x) {


case 0: printf(


case 1:


switch(y) {









case '0': printf(






case '1': printf(





}




default: printf(


}


7.


To execute the command:


prog at my home


, the value of *(*(argv+2)+1) is ___


y


___.


8.


The following program prints out __


3#2#


___.






#include






void f(int *x,int *y)


{




int *p;


p=x; x=y; y=p;


}


void main()



C Programming



TEST PAPER, Jan 24, 2007






















































2 / 10


{




int x=3, y=2;










f(&y, &x);










printf(


}


9.


The following program prints out __


5#0#


___.


# include






int f(int m)
























{





static int k=0;











int s=0;






















for(; k<=m; k++) s++;










return s;


}


void main( )


{




int s=1;


s=f(4);










printf(


}


10.


The following program prints out ___


-1#-1#-2#


__.


#include




int fun(int x)


{


int t;


if(x<=0)




t=x;


else


t=fun(x-1)+fun(x-2);










return t;


}


void main()


{




int i;










for(i=1;i<=3;i++)


printf(


}


11.


The following program prints out __


298


___.



#include


void main( )



C Programming



TEST PAPER, Jan 24, 2007















3 / 10










































{










int i=0, n;










char s[10]=






n=0;










for(i=0; s[i]!='0'; i++)













if(s[i]<='9'&&s[i]>='0')


















n=n*10+(s[i]-'0');













else

















break;











printf(


}






12.


The following code fragment prints out __


12


___.



int a[]={1,2,3,4,5,6,7}, *p, s;






for(s=0, p=a+1; p<=a+6; p=p+2)









s+= *p;






printf(“%d”, s);



13.


Use


typedef


to define a pointer type that points to a function returning float type _____.


typedef float *P();


14.


For the following array a, the value of *(a[1]+1) is



__


4


___.


int a[3][2]={1,2,3,4,5,6};


15.


For the following definition, the value of



(s[0].b)/(++p)->a



is __


0


___.


struct {


int a;


int b;


} s[2]={2,4,6,8}, *p=s;




Section 3: Read each of the following programs and answer questions (



marks for each


item, total marks: 30)



1



When input :



How Are You?


, the output of the following program is__


Hsa


___.



#include


void main()


{


char s[80];


int i=0;


scanf(


while(s[i]!='0') {


if(s[i]>='a'&& s[i]<='v') s[i] += 4;


else if(s[i]>='w'&& s[i]<='z') s[i] -= 22;




i++;


}



C Programming



TEST PAPER, Jan 24, 2007






















































4 / 10

-


-


-


-


-


-


-


-



本文更新与2021-02-09 22:14,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/624369.html

浙江大学c程2006A试卷E的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文