几个简单的C语言主题

B2。变量A和B最初分别是10和20。正确的说法是:

A: int a=10,int b = 20B: int a=10,b = 20

c:int a = 10;b = 20d:int a = 10;b=20,

C3。以下选项中正确的C语言常量是:

甲:0xEfGh乙:“XYZ”

丙:12.34e5丁:' \5A '

A4。提供双x;char s[50];输出双精度浮点数X和字符串s,正确的说法是:

A: printf("%lf %s ",x,s);B: printf("%ld %s ",x,s);

printf("%lf %s ",& amp& ampx,s);D: printf("%lf %s ",x,s[50]);

B5。语句printf ("%.1f,% d \ n ",10)。/4, 10/8);的输出是:

甲:2.5,1.25乙:2.5,1

丙:1.1.25丁:21.25

B6。提供充电箱;和语句“ch = getchar();”等效的说法是:

A: scanf("%c ",ch) B: scanf("%c ",& ampch);

C: printf("%c ",ch);D: printf("%c ",& ampch);

C7。设int n,m;使m成为n的十进制百分位数的语句是:

a:m = n/100;b:m = n % 100;

c:m = n/100% 10;d:m = n % 10/100;

C8。让x,y浮动;使y成为x的小数部分的语句是:

a:y =(int)x;b:y = int(x);

c:y = x-(int)x;d:y = x-int(x);

C9。以及语句“m+=(x = 5)+(-y);”等效的语句序列是:

a:m = m+x+y;x = 5;y = y-1;b:x = 5;m = m+x+y;y = y-1;

c:x = 5;y = y-1;m = m+x+y;d:y = y-1;m = m+x+y;x = 5;

B10。设int n;对应“n是两位数(10到99)”的判断表达式为:

答:10 & lt;= n & lt= 99 B:10 & lt;= n & amp& amp& amp& ampn & lt=99

c:10 & lt;= n | | n & lt= 99d:10 & lt;=n,n & lt=99

A11。设char ch判断“ch为数字字符”的表达式为:

答:ch & gt= ' 0 ' & amp& amp& amp& ampch & lt= ' 9 ' B:ch & gt;0 & amp& amp& amp& ampch & lt九

c:ch & gt;= ' 0 ' | | ch & lt= ' 9 ' D:ch & gt;= 0 | | ch & lt=9

A12。以及语句“x+=(a++==b)?c:-d;"功能等同的句子片段是:

a:if(a = = b){ a = a+1;x = x+c;}

else { a = a+1;d = d-1;x = x+d;}

b:a = a+1;if(a = = b){ x = x+c;}

else { d = d-1;x = x+d;}

c:if(a = = b){ a = a+1;x = x+c;}

else { a = a+1;x = x+d;d = d-1;}

d:if(a = = b){ a = a+1;x = c;}

else { a = a+1;d = d-1;x = d;}

C13。在I中被提供了;写出下列语句的运行结果:

for(I = 0;我& lt5;i++)

printf("%d ",I);

甲:0123456乙:012345

C: 01234 D: 0123

C14。提供充电箱;写出下列语句的运行结果:

for(ch = ' B ';ch & lt= ' Fch++)

putchar(ch);

甲:ABCDEFG乙:ABCDEF

C: BCDEF D: BCDEFG

A15。在下列一维数组的定义中,正确的是:

A: int a[5] = { 1,2,3,4,5 };B: int a[5] = 1,2,3,4,5;

C: int a[1到5];D: int a[]

D16..以下字符串定义和赋值是正确的:

答:char s[80];s = {'A ',' B ',' C ' };b:char s[80];s = " ABC

c;char s[80] = {"A "," B "," C " };d:char s[80]= " ABC ";

B17。在字符串的常用函数中,用于复制字符串的函数是:

甲:strlen乙:strcpy

C: strcat D: strcmp

B18。它被定义为int i,a[10];可以正确输入数组A的每个元素的语句是:

答:I = 10;scanf("%d ",& ampa[I]);b:for(I = 0;我& lt=9;i++) scanf("%d ",a+I);

c:for(I = 0;我& lt10;i++)scanf("%d ",a[I]);d:for(I = 0;我& lt10;i++)scanf("%d ",& ampa);

B19。它有定义:int A [10] = {6,7,8,9,10 };正确的解释是:

a:给a[1]到a[5]赋值五个初始值B:依次给a[0]到a[4]赋值五个初始值。

c:给a[6]到a[10]赋值五个初始值D:依次给a[5]到a[9]赋值五个初始值。