试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
以下程序运行后的输出结果是( ) 。
#include
void fun(int x)
{if(x/5>0) fun(x/5);
printf(“%d”,x);
}
main()
{fun(11); printf(“\n”);}

A、211

B、212

C、213

D、214

答案:A

试题通
信息技术知识竞赛c语言
试题通
若给出以下定义:
char x[ ]="abcdefg";
char y[ ]={'a','b','c','d','e','f','g'};
则正确的叙述为( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651d.html
点击查看题目
有以下程序
main()
{int i;
for(i=1;i<=40;i++)
{if(i++%5==0)
if (++i%8==0) printf("%d",i) ;}
printf("\n") ;} 执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651b.html
点击查看题目
有以下程序
main()
{int k=5,n=0;
do
{switch(k)
{case 1: case 3:n+=1; break;
default:n=0;k--;
case 2: case4:n+=2;k--;break;}
printf(“%d”,n);
}while(k>0&&n<5);}
程序运行后的输出结果是()
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346507.html
点击查看题目
有以下程序
#include "stdio.h"
void main()
{ int a=0,b=1,c=0,d=20;
if(a) d=d-10;
else if(!b)
if(!c) d=1;
else d=25;
printf("d=%d\n",d);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650a.html
点击查看题目
有以下程序
main()
{char *p[]={"3697","2584"};
int i,j;long num=0;
for(i=0;i<2;i++)
{j=0;
while(p[i][j]!="\0")
{if((p[i][j]-"0")%2)num=10*num+p[i][j]-"0";
j+=2;
}
}
printf("%d\n",num);
}
程序执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651a.html
点击查看题目
若有说明:int a[10];则对a 数组元素的正确引用是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346504.html
点击查看题目
执行以下语句:x+=y;y=x-y;x-=y;的功能是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651c.html
点击查看题目
运行结果是( )
switch ( ‘B’ )
{case ‘A’:printf("abc");break;
case ‘B’:switch(1)
{case 0:printf("a");break;
case 1;printf("b");break;
default:printf("c");break;
}
default:printf("x");
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346512.html
点击查看题目
下列程序的输出结果是()。
main()
{ double d=3.2; int x,y;
x=1.2; y=(x+3.8)/5.0;
printf("%d \n", d*y);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346507.html
点击查看题目
设有声明语句:int a=1,b=0;则执行以下语句后输出() 。
switch (a)
{
case 1:
switch (b)
{
case 0: printf("**0**");break;
case 1: printf("**1**");break;
}
case 2: printf("**2**");break;
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346515.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

以下程序运行后的输出结果是( ) 。
#include
void fun(int x)
{if(x/5>0) fun(x/5);
printf(“%d”,x);
}
main()
{fun(11); printf(“\n”);}

A、211

B、212

C、213

D、214

答案:A

试题通
试题通
信息技术知识竞赛c语言
相关题目
若给出以下定义:
char x[ ]="abcdefg";
char y[ ]={'a','b','c','d','e','f','g'};
则正确的叙述为( )。

A. 数组x和数组y等价

B. 数组x和数组y的长度相同

C. 数组x的长度大于数组y的长度

D. 数组x的长度小于数组y的长度

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651d.html
点击查看答案
有以下程序
main()
{int i;
for(i=1;i<=40;i++)
{if(i++%5==0)
if (++i%8==0) printf("%d",i) ;}
printf("\n") ;} 执行后的输出结果是()。

A. 5

B. 24

C. 32

D. 40

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651b.html
点击查看答案
有以下程序
main()
{int k=5,n=0;
do
{switch(k)
{case 1: case 3:n+=1; break;
default:n=0;k--;
case 2: case4:n+=2;k--;break;}
printf(“%d”,n);
}while(k>0&&n<5);}
程序运行后的输出结果是()

A. 2345

B. 235

C. 23456

D. 2356

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346507.html
点击查看答案
有以下程序
#include "stdio.h"
void main()
{ int a=0,b=1,c=0,d=20;
if(a) d=d-10;
else if(!b)
if(!c) d=1;
else d=25;
printf("d=%d\n",d);
}
执行后的输出结果是( )。

A. d=10

B. d=15

C. d=20

D. d=25

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e034650a.html
点击查看答案
有以下程序
main()
{char *p[]={"3697","2584"};
int i,j;long num=0;
for(i=0;i<2;i++)
{j=0;
while(p[i][j]!="\0")
{if((p[i][j]-"0")%2)num=10*num+p[i][j]-"0";
j+=2;
}
}
printf("%d\n",num);
}
程序执行后的输出结果是()。

A. 35

B. 37

C. 39

D. 3975

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651a.html
点击查看答案
若有说明:int a[10];则对a 数组元素的正确引用是()。

A. a[10]

B. a[3.5]

C. a(5)

D. a[10-10]

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346504.html
点击查看答案
执行以下语句:x+=y;y=x-y;x-=y;的功能是()。

A. 把x和y按从大到小排列

B. 把x和y按从小到大排列

C. 无确定结果

D. 交换x和y中的值

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651c.html
点击查看答案
运行结果是( )
switch ( ‘B’ )
{case ‘A’:printf("abc");break;
case ‘B’:switch(1)
{case 0:printf("a");break;
case 1;printf("b");break;
default:printf("c");break;
}
default:printf("x");
}

A. ax

B. bx

C. cx

D. dx

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346512.html
点击查看答案
下列程序的输出结果是()。
main()
{ double d=3.2; int x,y;
x=1.2; y=(x+3.8)/5.0;
printf("%d \n", d*y);
}

A. 3

B. 3.2

C. 0

D. 3.07

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e0346507.html
点击查看答案
设有声明语句:int a=1,b=0;则执行以下语句后输出() 。
switch (a)
{
case 1:
switch (b)
{
case 0: printf("**0**");break;
case 1: printf("**1**");break;
}
case 2: printf("**2**");break;
}

A. **0**

B. **0****2**

C. **0****1****2**

D. 有语法错误

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346515.html
点击查看答案
试题通小程序
试题通app下载