APP下载
首页
>
文学知识
>
C语言程序设计题库
搜索
C语言程序设计题库
题目内容
(
单选题
)
2.下面数组声明语句中正确的是( )。

A、 int n, a[n];

B、 int a[];

C、 int a[2][3]={{2},{1},{3}};

D、 int a[ ][3]={{2},{1},{3}};

答案:空

C语言程序设计题库
2.若函数调用时的实参为变量,则下面关于函数形参和实参的叙述中正确的是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-e5c0-c003-bc7499099f01.html
点击查看题目
2.下面程序运行时输出结果是()。
#include
int n=1;
int main()
{printf( ); return 0;}
#define n 2
int f( )
{return n+x; }
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-66a8-c003-bc7499099f00.html
点击查看题目
1.auto2.void3.main()4.return
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f7-1c28-c003-bc7499099f00.html
点击查看题目
6.本程序的功能是:取出一个十进制正整数中的所有偶数数字,用这些数字构成一个最大数。例如,由123456中取出2、4、6,组成的最大数为642。
#include
#define N 10
int main()
{int i,j,k=0,t,d,a[N]; long n,m=0;
printf( );
scanf( );
while(n>0)
{t=( (13) );
if(t%2==0) a[k++]=t;
n/=10;}
for(i=0;i<k-1;i++)
{d=i;
for(j=i+1;j<k;j++)
if( ) d=j;
if(( (14) ))
{t=a[d];a[d]=a[i];a[i]=t;}
}
for(i=0;i<k;i++)
m=( (15) );
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-99b8-c003-bc7499099f00.html
点击查看题目
5.下面程序运行后输出结果中的最后一行为()。
#include
int main()
{ int i, j,b[3][3]={0};
for(i=0; i<3; i++)
{ for(j=0; j<3; j++)
switch(i-j+2)
{ case 0:
case 1: b[i][j]=1;break;
case 2: b[i][j]=2;break;
case 3: b[i][j]=3;break;
case 4: b[i][j]=4;break;
}
}
for(i=0; i<3; i++)
{ for(j=0; j<3; j++)
printf("%2d", b[i][j]);
printf( );
}
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-2488-c003-bc7499099f00.html
点击查看题目
45.已知函数f的定义如下:
void f( )
{ int i;
for(i=0; i<y; i++)
x[i]+=y;
}
若main()函数中有声明“int a[10]={10};”及调用函数f的语句,则调用函数f的正确形式是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-5708-c003-bc7499099f00.html
点击查看题目
17.以下程序运行时输出结果是________。
#include
int main( )
{int a=0, b=0, c=0;
if ( intf( );
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-e268-c003-bc7499099f02.html
点击查看题目
13.算术运算符、赋值运算符和关系运算符的运算优先级按从高到低的顺序依次为( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-1148-c003-bc7499099f01.html
点击查看题目
7. 已有定义“int c, d;”,且c和d的值均大于0,表达式“c%d+c/d*d==c”的值为________。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-55c8-c003-bc7499099f00.html
点击查看题目
42.下面程序在运行时,输入elephant后的输出结果是________。
#include
int main()
{ int i=0, k, ch;
static int num[5];
char alpha[]={'a', 'e', 'i', 'o', 'u'}, in[80];
gets( );
while( )
{ for(k=0; k<5; k++)
if( )
{num[k]++;
break;}
i++;
}
for(k=0; k<5; k++)
if( ) printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-2228-c003-bc7499099f00.html
点击查看题目
首页
>
文学知识
>
C语言程序设计题库
题目内容
(
单选题
)
手机预览
C语言程序设计题库

2.下面数组声明语句中正确的是( )。

A、 int n, a[n];

B、 int a[];

C、 int a[2][3]={{2},{1},{3}};

D、 int a[ ][3]={{2},{1},{3}};

答案:空

分享
C语言程序设计题库
相关题目
2.若函数调用时的实参为变量,则下面关于函数形参和实参的叙述中正确的是( )。

A.  实参和其对应的形参占用同一存储单元

B.  形参不占用存储单元

C.  相同名称的实参和形参占用同一存储单元

D.  实参和其对应的形参占用不同的存储单元

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-e5c0-c003-bc7499099f01.html
点击查看答案
2.下面程序运行时输出结果是()。
#include
int n=1;
int main()
{printf( ); return 0;}
#define n 2
int f( )
{return n+x; }
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-66a8-c003-bc7499099f00.html
点击查看答案
1.auto2.void3.main()4.return
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f7-1c28-c003-bc7499099f00.html
点击查看答案
6.本程序的功能是:取出一个十进制正整数中的所有偶数数字,用这些数字构成一个最大数。例如,由123456中取出2、4、6,组成的最大数为642。
#include
#define N 10
int main()
{int i,j,k=0,t,d,a[N]; long n,m=0;
printf( );
scanf( );
while(n>0)
{t=( (13) );
if(t%2==0) a[k++]=t;
n/=10;}
for(i=0;i<k-1;i++)
{d=i;
for(j=i+1;j<k;j++)
if( ) d=j;
if(( (14) ))
{t=a[d];a[d]=a[i];a[i]=t;}
}
for(i=0;i<k;i++)
m=( (15) );
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-99b8-c003-bc7499099f00.html
点击查看答案
5.下面程序运行后输出结果中的最后一行为()。
#include
int main()
{ int i, j,b[3][3]={0};
for(i=0; i<3; i++)
{ for(j=0; j<3; j++)
switch(i-j+2)
{ case 0:
case 1: b[i][j]=1;break;
case 2: b[i][j]=2;break;
case 3: b[i][j]=3;break;
case 4: b[i][j]=4;break;
}
}
for(i=0; i<3; i++)
{ for(j=0; j<3; j++)
printf("%2d", b[i][j]);
printf( );
}
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f3-2488-c003-bc7499099f00.html
点击查看答案
45.已知函数f的定义如下:
void f( )
{ int i;
for(i=0; i<y; i++)
x[i]+=y;
}
若main()函数中有声明“int a[10]={10};”及调用函数f的语句,则调用函数f的正确形式是( )。

A.  f(a[],a[0]);

B.  f(a[0],a[0]);

C.  f(&a[0],a[0]);

D.  f(a[0],&a[0]);

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-5708-c003-bc7499099f00.html
点击查看答案
17.以下程序运行时输出结果是________。
#include
int main( )
{int a=0, b=0, c=0;
if ( intf( );
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-e268-c003-bc7499099f02.html
点击查看答案
13.算术运算符、赋值运算符和关系运算符的运算优先级按从高到低的顺序依次为( )。

A.  算术运算、赋值运算、关系运算

B.  关系运算、赋值运算、算术运算

C.  算术运算、关系运算、赋值运算

D.  关系运算、算术运算、赋值运算

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-1148-c003-bc7499099f01.html
点击查看答案
7. 已有定义“int c, d;”,且c和d的值均大于0,表达式“c%d+c/d*d==c”的值为________。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-55c8-c003-bc7499099f00.html
点击查看答案
42.下面程序在运行时,输入elephant后的输出结果是________。
#include
int main()
{ int i=0, k, ch;
static int num[5];
char alpha[]={'a', 'e', 'i', 'o', 'u'}, in[80];
gets( );
while( )
{ for(k=0; k<5; k++)
if( )
{num[k]++;
break;}
i++;
}
for(k=0; k<5; k++)
if( ) printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-2228-c003-bc7499099f00.html
点击查看答案
试题通小程序
试题通app下载