试题通
试题通
APP下载
首页
>
文学知识
>
C语言程序设计题库
试题通
搜索
C语言程序设计题库
题目内容
(
单选题
)
1.下列程序的输出结果是( )。
#include
int main()
{ int k, j, m, n, a[6][6], b[6];
m=3, n=2;
for(k=0; k<m; k++)
for(j=0; j<n; j++)
a[k][j] = k*n+j+1;
for(k=0; k<m; k++)
{b[k] = 0;
for(j=0; j<n; j++)
b[k] += a[k][j];
}
for(k=0; k<m; k++)
printf("%3d", b[k]);
return 0;
}

答案:空

试题通
C语言程序设计题库
试题通
13.已有函数fun的定义“int fun( ){ if( )return ( );else return ( ); }”,在main()函数中若调用函数f(3, 4),得到的返回值是________。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-0118-c003-bc7499099f00.html
点击查看题目
3.下列一维数组的声明中正确的是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-a788-c003-bc7499099f01.html
点击查看题目
4.计算下式求出e的值(保留两位小数),要求使用循环嵌套。

#include
int main()
{ int k=1,i,n,t;
float e=1,s=1;
scanf( );
do
{ t=1;
for(i=1;i<=k;i++)
t=t*i;
e=e+1.0/t;
k++;
}while( );
printf("%.2f",e);
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-8460-c003-bc7499099f00.html
点击查看题目
7.执行下面程序段后,num的值是( )。
char ch[]="Hello!"; int num;
num=sizeof( );
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-9bd0-c003-bc7499099f01.html
点击查看题目
17.若调用一个函数,且此函数中没有return语句,则正确的说法是()。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-08e8-c003-bc7499099f01.html
点击查看题目
1.3.1400002.3.0/4*n*( ) 3.unsigned4.8
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-d0f8-c003-bc7499099f00.html
点击查看题目
3.i*n+j4.just5.36.字符串
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-7c48-c003-bc7499099f00.html
点击查看题目
7.函数 xtoi 的功能是将放在字符串中的十六进制数(可以出现'0'~'9'、'a'~'f')转换成十进制整数。例如:调用 xtoi("1f") 将返回31。
xtoi(( (18) ))
{ int k, d=0;
for(k=0; s[k] ==' ' || s[k] == '\t'; k++);
while(s[k] >='0' && s[k] <= '9' || s[k] >= 'a' && s[k] <= 'f')
{if (s[k] >= '0' && s[k] <= '9')
( (19) );
if ( )
( (20) );
k++;
}
return d;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-5cc0-c003-bc7499099f00.html
点击查看题目
9.6 7 910.18,22,1511.2 1 4 3 612.6 8 9
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-8800-c003-bc7499099f01.html
点击查看题目
7.已有定义“int a=1;”,则执行“printf("%d", (a+5,a++));”时输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-1360-c003-bc7499099f01.html
点击查看题目
首页
>
文学知识
>
C语言程序设计题库
题目内容
(
单选题
)
手机预览
试题通
C语言程序设计题库

1.下列程序的输出结果是( )。
#include
int main()
{ int k, j, m, n, a[6][6], b[6];
m=3, n=2;
for(k=0; k<m; k++)
for(j=0; j<n; j++)
a[k][j] = k*n+j+1;
for(k=0; k<m; k++)
{b[k] = 0;
for(j=0; j<n; j++)
b[k] += a[k][j];
}
for(k=0; k<m; k++)
printf("%3d", b[k]);
return 0;
}

答案:空

试题通
分享
试题通
试题通
C语言程序设计题库
相关题目
13.已有函数fun的定义“int fun( ){ if( )return ( );else return ( ); }”,在main()函数中若调用函数f(3, 4),得到的返回值是________。

A.  3

B.  4

C.  3和4

D.  4和3

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-0118-c003-bc7499099f00.html
点击查看答案
3.下列一维数组的声明中正确的是( )。

A.  int a[];

B.  int n=5,a[n];

C.  int a[4+1]={0};

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

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-a788-c003-bc7499099f01.html
点击查看答案
4.计算下式求出e的值(保留两位小数),要求使用循环嵌套。

#include
int main()
{ int k=1,i,n,t;
float e=1,s=1;
scanf( );
do
{ t=1;
for(i=1;i<=k;i++)
t=t*i;
e=e+1.0/t;
k++;
}while( );
printf("%.2f",e);
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-8460-c003-bc7499099f00.html
点击查看答案
7.执行下面程序段后,num的值是( )。
char ch[]="Hello!"; int num;
num=sizeof( );
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-9bd0-c003-bc7499099f01.html
点击查看答案
17.若调用一个函数,且此函数中没有return语句,则正确的说法是()。

A.  该函数没有返回值

B.  返回若干个系统默认值

C.  能返回一个用户所希望的函数值

D.  返回一个不确定的值

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f5-08e8-c003-bc7499099f01.html
点击查看答案
1.3.1400002.3.0/4*n*( ) 3.unsigned4.8
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-d0f8-c003-bc7499099f00.html
点击查看答案
3.i*n+j4.just5.36.字符串
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-7c48-c003-bc7499099f00.html
点击查看答案
7.函数 xtoi 的功能是将放在字符串中的十六进制数(可以出现'0'~'9'、'a'~'f')转换成十进制整数。例如:调用 xtoi("1f") 将返回31。
xtoi(( (18) ))
{ int k, d=0;
for(k=0; s[k] ==' ' || s[k] == '\t'; k++);
while(s[k] >='0' && s[k] <= '9' || s[k] >= 'a' && s[k] <= 'f')
{if (s[k] >= '0' && s[k] <= '9')
( (19) );
if ( )
( (20) );
k++;
}
return d;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-5cc0-c003-bc7499099f00.html
点击查看答案
9.6 7 910.18,22,1511.2 1 4 3 612.6 8 9
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f4-8800-c003-bc7499099f01.html
点击查看答案
7.已有定义“int a=1;”,则执行“printf("%d", (a+5,a++));”时输出结果是( )。

A.  1

B.  6

C.  2

D.  7

https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f0-1360-c003-bc7499099f01.html
点击查看答案
试题通小程序
试题通app下载