APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
有以下程序
#include
fun(int n, int *s)
{ int f1, f2;
if(n==1||n==2)
*s=1;
else
{ fun(n-1, &f1);
fun(n-2, &f2);
*s=f1+f2;
}
}
void main()
{ int x;
fun(6, &x);
printf("%d\n", x);
}
执行后的输出结果是( )。

A、9

B、8

C、7

D、6

答案:B

信息技术知识竞赛c语言
以下程序的输出结果是()。
union myun
{ struct
{ int x, y, z; } u;
int k;
} a;
main()
{ a.u.x=4; a.u.y=5; a.u.z=6;
a.k=0;
printf("%d\n",a.u.x);}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650d.html
点击查看题目
下列程序的输出结果是()。
int b=2;
int func(int *a)
{ b += *a; return(b);}
main()
{ int a=2, res=2;
res += func(&a);
printf("%d \n",res);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346507.html
点击查看题目
请读程序:
main()
{ int a=1,b=2;
printf("%d\n",a=a+1,a+6,b+2);}
则上面程序的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651d.html
点击查看题目
有以下程序
#include “stdio.h”
void main()
{ int x, y, z;
x=y=1;
z=x++,y++,++y;
printf("%d,%d,%d\n",x,y,z);
}
程序运行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346512.html
点击查看题目
下面程序的输出结果是()。
#include
#include
main()
{ char *p1="abc",*p2="ABC",str[50]= "xyz";
strcpy(str+2,strcat(p1,p2));
printf("%s\n",str);}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650a.html
点击查看题目
有以下程序
main()
{int i,t[][3]={9,8,7,6,5,4,3,2,1};
for(i=0;i<3;i++) printf("%d",t[2-i][i]);
}
程序执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346512.html
点击查看题目
若有以下程序片段:
char str[ ]="ab\n\012\\\"";
printf("%d",strlen(str));
上面程序片段的输出结果是 ( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346520.html
点击查看题目
有以下程序
#include
void main()
{
int a[][2]={10,20,30,40,50,60},(*p)[2];
p=a;
printf("%d\n",*(*(p+2)+1));
}
程序运行后的输出结果是 ( )。  
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650e.html
点击查看题目
以下所列的各函数首部中,正确的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346522.html
点击查看题目
有以下程序
fun(int x)
{ int p;
if(x==0||x==1) return(3);
p=x-fun(x-2);
return p;
}
main()
{ printf("%d\n",fun(7)); }
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346510.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

有以下程序
#include
fun(int n, int *s)
{ int f1, f2;
if(n==1||n==2)
*s=1;
else
{ fun(n-1, &f1);
fun(n-2, &f2);
*s=f1+f2;
}
}
void main()
{ int x;
fun(6, &x);
printf("%d\n", x);
}
执行后的输出结果是( )。

A、9

B、8

C、7

D、6

答案:B

信息技术知识竞赛c语言
相关题目
以下程序的输出结果是()。
union myun
{ struct
{ int x, y, z; } u;
int k;
} a;
main()
{ a.u.x=4; a.u.y=5; a.u.z=6;
a.k=0;
printf("%d\n",a.u.x);}

A. 4

B. 5

C. 6

D. 0

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650d.html
点击查看答案
下列程序的输出结果是()。
int b=2;
int func(int *a)
{ b += *a; return(b);}
main()
{ int a=2, res=2;
res += func(&a);
printf("%d \n",res);
}

A. 4

B. 6

C. 8

D. 10

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346507.html
点击查看答案
请读程序:
main()
{ int a=1,b=2;
printf("%d\n",a=a+1,a+6,b+2);}
则上面程序的输出结果是()。

A. 2

B. 3

C. 4

D. 1

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651d.html
点击查看答案
有以下程序
#include “stdio.h”
void main()
{ int x, y, z;
x=y=1;
z=x++,y++,++y;
printf("%d,%d,%d\n",x,y,z);
}
程序运行后的输出结果是( )。

A. 1,2,3

B. 1,3,2

C. 2,3,1

D. 3,1,2

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346512.html
点击查看答案
下面程序的输出结果是()。
#include
#include
main()
{ char *p1="abc",*p2="ABC",str[50]= "xyz";
strcpy(str+2,strcat(p1,p2));
printf("%s\n",str);}

A. xyzabcABC

B. zabcABC

C. xyabcABC

D. yzabcABC

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034650a.html
点击查看答案
有以下程序
main()
{int i,t[][3]={9,8,7,6,5,4,3,2,1};
for(i=0;i<3;i++) printf("%d",t[2-i][i]);
}
程序执行后的输出结果是()。

A. 7 5 3

B. 3 5 7

C. 3 6 9

D. 7 5 1

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346512.html
点击查看答案
若有以下程序片段:
char str[ ]="ab\n\012\\\"";
printf("%d",strlen(str));
上面程序片段的输出结果是 ( )。

A. 3

B. 4

C. 6

D. 12

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346520.html
点击查看答案
有以下程序
#include
void main()
{
int a[][2]={10,20,30,40,50,60},(*p)[2];
p=a;
printf("%d\n",*(*(p+2)+1));
}
程序运行后的输出结果是 ( )。  

A. 10

B. 20

C. 40

D. 60

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650e.html
点击查看答案
以下所列的各函数首部中,正确的是()。

A. void play(var a:integer,var b:integer)

B. void play(int a,b)

C. void play(int a,int b)

D. sub play(a as integer,b as integer)

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346522.html
点击查看答案
有以下程序
fun(int x)
{ int p;
if(x==0||x==1) return(3);
p=x-fun(x-2);
return p;
}
main()
{ printf("%d\n",fun(7)); }
执行后的输出结果是( )。

A. 7

B. 3

C. 2

D. 0

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