'\0';" />
试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
有如下程序
main()
{ char ch[2][5]={"6937","8254"},*p[2];
int i,j,s=0;
for(i=0;i<2;i++)p[i]=ch[i];
for(i=0;i<2;i++)
for(j=0;p[i][j]>'\0';j+=2)
s=10*s+p[i][j]-'0';
printf("%d\n",s);}
该程序的输出结果是()。

A、69825

B、63825

C、6385

D、693825

答案:C

试题通
信息技术知识竞赛c语言
试题通
有以下程序
main()
{ char s[ ]= "abcde"; s+=2; printf("%d\n",s[0]); }
执行后的结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346509.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
点击查看题目
x,y,z被定义为int型变量,若从键盘给x,y,z输入数据,正确的输入语句是 ()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346521.html
点击查看题目
有以下程序
#include
# include
char *fun(char *t)
{
char *p=t;
return(p+strlen(t)/2);
}
void main()
{
char *str="abcdefgh";
str=fun(str);
puts(str);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346500.html
点击查看题目
对以下for循环,叙述正确的是()。
for(x=0,y=0;(y!=123)&&(x<4);x++,y++);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651e.html
点击查看题目
若有数组定义: char array [ ]="China"; 则数组 array所占的空间为( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651e.html
点击查看题目
设有如下定义:

struct sk
{int a;float b;}data,*p;
若有p=&data;,则对data中的a域的正确引用是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346511.html
点击查看题目
有以下程序
  #include
  void fun(char *c)
  { while(*c)
  { if(*c>='a'&&*c<='z') *c=*c-('a'-'A');
  c++;
  }
  }
  void main()
  { char s[81];
  gets(s); fun(s); puts(s):
  }
  当执行程序时从键盘上输入Hello Beijing<回车>,则程序的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650d.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
点击查看题目
设有定义:double x[10],*p=x;,以下能给数组x下标为6的元素读入数据的正确语句是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346528.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

有如下程序
main()
{ char ch[2][5]={"6937","8254"},*p[2];
int i,j,s=0;
for(i=0;i<2;i++)p[i]=ch[i];
for(i=0;i<2;i++)
for(j=0;p[i][j]>'\0';j+=2)
s=10*s+p[i][j]-'0';
printf("%d\n",s);}
该程序的输出结果是()。

A、69825

B、63825

C、6385

D、693825

答案:C

试题通
试题通
信息技术知识竞赛c语言
相关题目
有以下程序
main()
{ char s[ ]= "abcde"; s+=2; printf("%d\n",s[0]); }
执行后的结果是()。

A. 输出字符a的ASCII码

B. 输出字符c的ASCII码

C. 输出字符c

D. 程序出错

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346509.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
点击查看答案
x,y,z被定义为int型变量,若从键盘给x,y,z输入数据,正确的输入语句是 ()。

A. INPUT x,y,z;

B. scanf("%d%d%d",&x,&y,&z);

C. scanf("%d%d%d",x,y,z);

D. read("%d%d%d",&x,&y,&z);

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346521.html
点击查看答案
有以下程序
#include
# include
char *fun(char *t)
{
char *p=t;
return(p+strlen(t)/2);
}
void main()
{
char *str="abcdefgh";
str=fun(str);
puts(str);
}
执行后的输出结果是( )。

A. efgh

B. abcd

C. bcde

D. cdef

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346500.html
点击查看答案
对以下for循环,叙述正确的是()。
for(x=0,y=0;(y!=123)&&(x<4);x++,y++);

A. 是无限循环

B. 循环次数不定

C. 执行了4次

D. 执行了3次

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e034651e.html
点击查看答案
若有数组定义: char array [ ]="China"; 则数组 array所占的空间为( )。

A. 4个字节

B. 5个字节

C. 6个字节

D. 7个字节

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034651e.html
点击查看答案
设有如下定义:

struct sk
{int a;float b;}data,*p;
若有p=&data;,则对data中的a域的正确引用是()。

A. (*p).data.a

B. (*p).a

C. p->data.a

D. p.data.a

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346511.html
点击查看答案
有以下程序
  #include
  void fun(char *c)
  { while(*c)
  { if(*c>='a'&&*c<='z') *c=*c-('a'-'A');
  c++;
  }
  }
  void main()
  { char s[81];
  gets(s); fun(s); puts(s):
  }
  当执行程序时从键盘上输入Hello Beijing<回车>,则程序的输出结果是( )。

A. hello beijing

B. Hello Beijing

C. HELLO BEIJING

D. hELLO Beijing

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034650d.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
点击查看答案
设有定义: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
点击查看答案
试题通小程序
试题通app下载