APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
以下程序运行后,输出结果是 ()。
fut (int **s,int p[2][3])
{ **s=p[1][1];)
main()
{ int a[2][3]={1,3,5,7,9,11},*p;
p=(int *)malloc(sizeof(int));
fut (&p,a);
printf("%d\n",*p);
}

A、1

B、7

C、9

D、11

答案:C

信息技术知识竞赛c语言
#include "stdio.h"
void main( )
{ char str[80];
scanf("%s",str);
insert(str);
}
insert(char s[])
{
int i;
for(i=strlen(s);i>0;i--)
{ s[2*i]=s[i];
s[2*i-1]=' ';
}
printf("%s",s);
}
如果输入的字符串是abcd, 则程序的运行结果是 ( ) 。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346508.html
点击查看题目
有以下程序
#include
main()
{int a=2,b;
b=a<<2; printf(“%d\n”,b);
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346516.html
点击查看题目
以数据块为单位对数据进行整体 读写时如果ptr是指向内存中数据块的首地址,fp是文件指针,那么数据块中每个数据项的大小为(  )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346505.html
点击查看题目
有以下程序
#include "stdio.h"
#include "string.h"
void main( )
{ char str[100] ="How do you do";
strcpy( str + strlen(str)/2, "es she");
printf("%s\n", str);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346513.html
点击查看题目
下列程序段输出结果是( )。
a=1;b=10;
do{
b-=a;
a++;
}while(b--<0);
printf("a,b=%d,%d",a,b);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034650d.html
点击查看题目
以下程序调用findmax函数返回数组中的最大值
findmax(int *a,int n)
{ int *p,*s;
for(p=a,s=a; p-a
if (______) s=p;
return(*s);
}
main()
{ int x[5]={12,21,13,6,18};
printf("%d\n",findmax(x,5));
}
在下划线处应填入的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346511.html
点击查看题目
表示关系x<=y<=z的c语言表达式为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346513.html
点击查看题目
设有以下宏定义:
#define N 3
#define Y(n) ( (N+1)*n)
则执行语句:z=2 * (N+Y(5+1));后,z的值为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346502.html
点击查看题目
有以下程序
main()
{int i,s=0,t[]={l,2,3,4,5,6,7,8,9};
for(i=0;i<9;i+=2)s+=*(t+i);
printf("%d\n",s);
}
程序执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346514.html
点击查看题目
以下叙述中不正确的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650d.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

以下程序运行后,输出结果是 ()。
fut (int **s,int p[2][3])
{ **s=p[1][1];)
main()
{ int a[2][3]={1,3,5,7,9,11},*p;
p=(int *)malloc(sizeof(int));
fut (&p,a);
printf("%d\n",*p);
}

A、1

B、7

C、9

D、11

答案:C

信息技术知识竞赛c语言
相关题目
#include "stdio.h"
void main( )
{ char str[80];
scanf("%s",str);
insert(str);
}
insert(char s[])
{
int i;
for(i=strlen(s);i>0;i--)
{ s[2*i]=s[i];
s[2*i-1]=' ';
}
printf("%s",s);
}
如果输入的字符串是abcd, 则程序的运行结果是 ( ) 。

A.
a
b
c
d

B. a c b d

C. a b c d

D. d
c
b
a

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346508.html
点击查看答案
有以下程序
#include
main()
{int a=2,b;
b=a<<2; printf(“%d\n”,b);
}
程序运行后的输出结果是()。

A. 2

B. 4

C. 6

D. 8

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346516.html
点击查看答案
以数据块为单位对数据进行整体 读写时如果ptr是指向内存中数据块的首地址,fp是文件指针,那么数据块中每个数据项的大小为(  )。

A. sizeof(*ptr)

B. *ptr

C. sizeof(ptr)

D. sizeof(*fp)

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346505.html
点击查看答案
有以下程序
#include "stdio.h"
#include "string.h"
void main( )
{ char str[100] ="How do you do";
strcpy( str + strlen(str)/2, "es she");
printf("%s\n", str);
}
执行后的输出结果是( )。

A. How do you do

B. es she

C. How are you

D. How does she

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346513.html
点击查看答案
下列程序段输出结果是( )。
a=1;b=10;
do{
b-=a;
a++;
}while(b--<0);
printf("a,b=%d,%d",a,b);

A. a,b=7,5

B. a,b=2,8

C. a,b=2,2

D. a,b=8,2

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034650d.html
点击查看答案
以下程序调用findmax函数返回数组中的最大值
findmax(int *a,int n)
{ int *p,*s;
for(p=a,s=a; p-a
if (______) s=p;
return(*s);
}
main()
{ int x[5]={12,21,13,6,18};
printf("%d\n",findmax(x,5));
}
在下划线处应填入的是()。

A. p>s

B. *p>*s

C. a[p]>a[s]

D. p-a>p-s

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346511.html
点击查看答案
表示关系x<=y<=z的c语言表达式为()。

A. (X<=Y) & & (Y<=Z)

B. (X<=Y)AND(Y<=Z)

C. (X<=Y<=Z)

D. (X<=Y)&(Y<=Z)

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346513.html
点击查看答案
设有以下宏定义:
#define N 3
#define Y(n) ( (N+1)*n)
则执行语句:z=2 * (N+Y(5+1));后,z的值为()。

A. 出错

B. 42

C. 48

D. 54

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

A. 45

B. 20

C. 25

D. 36

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346514.html
点击查看答案
以下叙述中不正确的是()。

A. 在C中,函数中的自动变量可以赋初值,每调用一次,赋一次初值。

B. 在C中,在调用函数时,实在参数和对应形参在类型上只需赋值兼容。

C. 在C中,外部变量的隐含类别是自动存储类别。

D. 在C中,函数形参可以说明为register变量。

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