APP下载
首页
>
文学知识
>
C语言程序设计题库
搜索
C语言程序设计题库
题目内容
(
单选题
)
5.在C程序中,若对函数类型未加说明,则函数的隐含类型为________。

A、 int

B、 double

C、 void

D、 char

答案:空

C语言程序设计题库
37.3 2 238.2 3 439.1111,1740.15 11 9 8 5 3
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f7-3780-c003-bc7499099f01.html
点击查看题目
1.输出1000之内的全部“完数”,要求每行输出5个,并统计完数的个数。一个数如果恰好等于它的因子之和,就称其为完数。
#include
int main()
{ int i,j,n=0,sum;
for(i=3;i<=1000;i++)
{ sum=0;
for(j=1;j<n-1;j++)
if(n%j==0)sum=sum+j;
if( )
{ printf( );
n++;
if(n%5==0) printf( );
}
}
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-70d8-c003-bc7499099f00.html
点击查看题目
18.已有定义“int a=7, b=2;”,则表达式“b+=( )( )/2”运算后b的值为( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-2ce8-c003-bc7499099f02.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
点击查看题目
10.下面程序运行后输出的结果是________。
#include
int main()
{ int x=8;
for(;x>0;x--)
{if(x%3==0)
{printf( );
continue;
}
printf( );
}
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-d880-c003-bc7499099f00.html
点击查看题目
2.下面程序的功能是:根据下列公式计算并输出f的值(n≥0)。

#include
float f1( )
{ float s=0.0, w, t=-1.0; int i;
for(i=0; i<=n; i++)
{ t=( (5) );
w=t/(2*i+1);
( (6) );
}
return s;
}
int main()
{ int n=5; float s;
( (7) );
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-31c8-c003-bc7499099f00.html
点击查看题目
4.下面程序的功能是:根据下列公式计算cos( )的近似值。精度要求:当通项的绝对值小于等于10-6时为止。

#include
#include<( (10) )>
double mycos( )
{ int n=1;
double s=0, t=1.0;
while (( (11) )>=1e-6)
{s+=t;
t*= ( (12) );
n=n+2;
}
return s;
}
int main()
{ double x;
scanf( );
printf( ;
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-4550-c003-bc7499099f00.html
点击查看题目
8.已有定义“int r=3;”,则执行语句“printf( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-2130-c003-bc7499099f02.html
点击查看题目
13.5432114.0 -6 9 6 115.2#18#16.30
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-6138-c003-bc7499099f01.html
点击查看题目
10.有若干学生(100~200),需要分组进行游戏。如果分成4人一组,则多2人;若分成7人一组,则多3人;若分成9人一组,则多5人。以下程序是求学生的总数。
#include
int main()
{ int i;
for(i=100;i<200;i++)
if((i-2)%4==0)
if(!((i-3)%7))
if(( (21) ))
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-41f8-c003-bc7499099f00.html
点击查看题目
首页
>
文学知识
>
C语言程序设计题库
题目内容
(
单选题
)
手机预览
C语言程序设计题库

5.在C程序中,若对函数类型未加说明,则函数的隐含类型为________。

A、 int

B、 double

C、 void

D、 char

答案:空

分享
C语言程序设计题库
相关题目
37.3 2 238.2 3 439.1111,1740.15 11 9 8 5 3
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f7-3780-c003-bc7499099f01.html
点击查看答案
1.输出1000之内的全部“完数”,要求每行输出5个,并统计完数的个数。一个数如果恰好等于它的因子之和,就称其为完数。
#include
int main()
{ int i,j,n=0,sum;
for(i=3;i<=1000;i++)
{ sum=0;
for(j=1;j<n-1;j++)
if(n%j==0)sum=sum+j;
if( )
{ printf( );
n++;
if(n%5==0) printf( );
}
}
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-70d8-c003-bc7499099f00.html
点击查看答案
18.已有定义“int a=7, b=2;”,则表达式“b+=( )( )/2”运算后b的值为( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-2ce8-c003-bc7499099f02.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
点击查看答案
10.下面程序运行后输出的结果是________。
#include
int main()
{ int x=8;
for(;x>0;x--)
{if(x%3==0)
{printf( );
continue;
}
printf( );
}
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f1-d880-c003-bc7499099f00.html
点击查看答案
2.下面程序的功能是:根据下列公式计算并输出f的值(n≥0)。

#include
float f1( )
{ float s=0.0, w, t=-1.0; int i;
for(i=0; i<=n; i++)
{ t=( (5) );
w=t/(2*i+1);
( (6) );
}
return s;
}
int main()
{ int n=5; float s;
( (7) );
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-31c8-c003-bc7499099f00.html
点击查看答案
4.下面程序的功能是:根据下列公式计算cos( )的近似值。精度要求:当通项的绝对值小于等于10-6时为止。

#include
#include<( (10) )>
double mycos( )
{ int n=1;
double s=0, t=1.0;
while (( (11) )>=1e-6)
{s+=t;
t*= ( (12) );
n=n+2;
}
return s;
}
int main()
{ double x;
scanf( );
printf( ;
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f6-4550-c003-bc7499099f00.html
点击查看答案
8.已有定义“int r=3;”,则执行语句“printf( )。
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3ef-2130-c003-bc7499099f02.html
点击查看答案
13.5432114.0 -6 9 6 115.2#18#16.30
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-6138-c003-bc7499099f01.html
点击查看答案
10.有若干学生(100~200),需要分组进行游戏。如果分成4人一组,则多2人;若分成7人一组,则多3人;若分成9人一组,则多5人。以下程序是求学生的总数。
#include
int main()
{ int i;
for(i=100;i<200;i++)
if((i-2)%4==0)
if(!((i-3)%7))
if(( (21) ))
printf( );
return 0;
}
https://www.shititong.cn/cha-kan/shiti/0005e1ec-b3f2-41f8-c003-bc7499099f00.html
点击查看答案
试题通小程序
试题通app下载