试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
设p1和p2是指向同一个int型一维数组的指针变量,k为int型变量,则不能正确执行的语句是()。

A、
k=*p1+*p2;

B、p2=k;

C、p1=p2;

D、k=*p1 * (*p2);

答案:B

试题通
信息技术知识竞赛c语言
试题通
设有定义:double x[10],*p=x;,以下能给数组x下标为6的元素读入数据的正确语句是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346528.html
点击查看题目
写出下列程序段运行结果()。
unsigned int a=3,b=10;
printf("%d\n",a<<2|b==1);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346506.html
点击查看题目
要使下列程序的输出结果是字符A,则下划线处应填 ( ) 。
main()
{
char x='b';
int i=0;
do{
--x;
}while( _____ );
printf("%c",x);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346504.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
点击查看题目
设有如下函数定义
  int fun(int k)
  { if (k<1) return 0;
  else if(k==1) return 1;
  else return fun(k-1)+1;
  }
  若执行调用语句:n=fun(3);,则函数fun总共被调用的次数是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346522.html
点击查看题目
下面程序的运行结果是 ( )。
#include “stdio.h”
int f(int a[],int n)
{ if(n>1)
return a[0] + f(a+1, n-1);
else
return a[0];
}
main()
{ int aa[10]={1,2,3,4,5,6,7,8,9,10}, s;
s = f(aa+2,4); printf("%d\n", s);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346513.html
点击查看题目
有以下程序
#include
main()
{int c[3]={0},k,I;
while((k=getchar())!=’\n’)
c[k-‘A’]++;
for(i=0;i<3;i++) printf(“%d”,c[i]); printf(“\n”);
}
若程序运行时从键盘输入ABCACC<回车>,则输出结果为 ( ) 。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651b.html
点击查看题目
C语言中数组下标的下限是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346518.html
点击查看题目
有以下程序段
struct st
{int x;int *y;}*pt;
int a[]={1,2},b[]={3,4};
struct st c[2]={10,a,20,b};
pt=c;
以下选项中表达式的值为11的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346529.html
点击查看题目
若变量已正确定义,有以下程序段
int a=3,b=5,c=7;
if(a>b) a=b; c=a;
if(c!=a) c=b;
printf("%d,%d,%d\n",a,b,c);
其输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346506.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

设p1和p2是指向同一个int型一维数组的指针变量,k为int型变量,则不能正确执行的语句是()。

A、
k=*p1+*p2;

B、p2=k;

C、p1=p2;

D、k=*p1 * (*p2);

答案:B

试题通
试题通
信息技术知识竞赛c语言
相关题目
设有定义:double x[10],*p=x;,以下能给数组x下标为6的元素读入数据的正确语句是( )。

A. scanf("%f",&x[6]);

B. scanf("%lf",*(x+6)); 

C. scanf("%lf",p+6);

D. scanf("%lf",p[6]);

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346528.html
点击查看答案
写出下列程序段运行结果()。
unsigned int a=3,b=10;
printf("%d\n",a<<2|b==1);

A.
13

B. 12

C. 8

D. 14

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346506.html
点击查看答案
要使下列程序的输出结果是字符A,则下划线处应填 ( ) 。
main()
{
char x='b';
int i=0;
do{
--x;
}while( _____ );
printf("%c",x);
}

A. i++<31

B. i++<32

C. i<31

D. i<32

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e0346504.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
点击查看答案
设有如下函数定义
  int fun(int k)
  { if (k<1) return 0;
  else if(k==1) return 1;
  else return fun(k-1)+1;
  }
  若执行调用语句:n=fun(3);,则函数fun总共被调用的次数是( )。

A. 2

B. 3

C. 4

D. 5

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346522.html
点击查看答案
下面程序的运行结果是 ( )。
#include “stdio.h”
int f(int a[],int n)
{ if(n>1)
return a[0] + f(a+1, n-1);
else
return a[0];
}
main()
{ int aa[10]={1,2,3,4,5,6,7,8,9,10}, s;
s = f(aa+2,4); printf("%d\n", s);
}

A. 16

B. 18

C. 20

D. 22

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346513.html
点击查看答案
有以下程序
#include
main()
{int c[3]={0},k,I;
while((k=getchar())!=’\n’)
c[k-‘A’]++;
for(i=0;i<3;i++) printf(“%d”,c[i]); printf(“\n”);
}
若程序运行时从键盘输入ABCACC<回车>,则输出结果为 ( ) 。

A. 211

B. 212

C. 213

D. 214

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e034651b.html
点击查看答案
C语言中数组下标的下限是()。

A. 1

B. 0

C. 视具体情况而定

D. 无固定下限

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346518.html
点击查看答案
有以下程序段
struct st
{int x;int *y;}*pt;
int a[]={1,2},b[]={3,4};
struct st c[2]={10,a,20,b};
pt=c;
以下选项中表达式的值为11的是()。

A. *pt->y

B. pt->x

C. ++pt->x

D. (pt++)->x

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346529.html
点击查看答案
若变量已正确定义,有以下程序段
int a=3,b=5,c=7;
if(a>b) a=b; c=a;
if(c!=a) c=b;
printf("%d,%d,%d\n",a,b,c);
其输出结果是( )。

A. 程序段有语法错

B. 3,5,3

C. 3,5,5

D. 3,5,7

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