试题通
试题通
APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
试题通
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
下列程序执行后的输出结果是(   )。 #include "stdio.h"
void main()
{
int a=-1,b=1,k;
if((++a<0)&&!(b--<=0))
printf("%d,%d\n",a,b);
else
printf("%d,%d\n",b,a);
}

A、1,0

B、0,1

C、1,1

D、0,0

答案:A

试题通
信息技术知识竞赛c语言
试题通
有以下程序
  #include
  main()
  { char s[]="012xy\08s34f4w2";
  int i,n=0;
  for(i=0;s[i]!=0;i++)
  if(s[i]>='0'&&s[i]<='9') n++;
  printf("%d\n",n);
  }
  程序运行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651d.html
点击查看题目
下面关于运算符优先顺序的描述中正确的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650e.html
点击查看题目
下程序运行后的输出结果是() 。
  #include
  main()
  { int a;
  a=(int)((double)(3/2)+0.5+(int)1.99*2);
  printf("%d\n",a);
  }
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346505.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
void fun(char *s)
{ while(*s)
{ if (*s%2==0) printf("%c",*s);
s++;
}
}
void main()
{
char a[]={"good"};
fun(a);
printf("\n");
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346503.html
点击查看题目
以下正确的描述是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650f.html
点击查看题目
有以下程序
  #include
  main()
  { int x=1,y=0;
  if(!x) y++;
  else if(x==0)
  if (x) y+=2;
  else y+=3;
  printf("%d\n",y);
  }
  程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651f.html
点击查看题目
有以下程序
#include
main()
{char ch[3][5]={“AAAA”,”BBB”,”CC”};
printf(“%s\n”,ch[1]);
}
程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346513.html
点击查看题目
若二维数组a有m行n列,则下面能够正确引用元素a[i][j]的为() 。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346518.html
点击查看题目
阅读下列程序:
main( )
{ int n[3],i,j,k;
for(i=0;i〈3;i++〉 n[i]=0;
k=2;
for (i=0;i〈k;i++〉
for (j=0;j〈k;j++〉 n[j]=n[i]+1;
printf("%d\n",n[1]); }
程序运行后输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346518.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
试题通
信息技术知识竞赛c语言

下列程序执行后的输出结果是(   )。 #include "stdio.h"
void main()
{
int a=-1,b=1,k;
if((++a<0)&&!(b--<=0))
printf("%d,%d\n",a,b);
else
printf("%d,%d\n",b,a);
}

A、1,0

B、0,1

C、1,1

D、0,0

答案:A

试题通
试题通
信息技术知识竞赛c语言
相关题目
有以下程序
  #include
  main()
  { char s[]="012xy\08s34f4w2";
  int i,n=0;
  for(i=0;s[i]!=0;i++)
  if(s[i]>='0'&&s[i]<='9') n++;
  printf("%d\n",n);
  }
  程序运行后的输出结果是( )。

A. 0

B. 3

C. 7

D. 8

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651d.html
点击查看答案
下面关于运算符优先顺序的描述中正确的是()。

A. 关系运算符< 算术运算符< 赋值运算符< 逻辑与运算符

B. 逻辑 运算符< 关系运算符< 算术运算符< 赋值运算符

C. 赋值运算符< 逻辑与运算符< 关系运算符< 算术运算符

D. 算术运算符< 关系运算符< 赋值运算符< 逻辑与运算符

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650e.html
点击查看答案
下程序运行后的输出结果是() 。
  #include
  main()
  { int a;
  a=(int)((double)(3/2)+0.5+(int)1.99*2);
  printf("%d\n",a);
  }

A. 3

B. 2

C. 0

D. 1

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346505.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
void fun(char *s)
{ while(*s)
{ if (*s%2==0) printf("%c",*s);
s++;
}
}
void main()
{
char a[]={"good"};
fun(a);
printf("\n");
}
执行后的输出结果是( )。

A. a

B. b

C. c

D. d

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6c48-c089-2897e0346503.html
点击查看答案
以下正确的描述是()。

A. continue语句的作用是结束整个循环的执行

B. 只能在循环体内和switch语句体内使用break语句

C. 在循环体内使用break语句或continue语句的作用相同

D. 从多层循环嵌套中退出时, 只能使用goto语句

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

A. 3

B. 2

C. 1

D. 0

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034651f.html
点击查看答案
有以下程序
#include
main()
{char ch[3][5]={“AAAA”,”BBB”,”CC”};
printf(“%s\n”,ch[1]);
}
程序运行后的输出结果是()。

A. AAAA

B. CC

C. BBBCC

D. BBB

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346513.html
点击查看答案
若二维数组a有m行n列,则下面能够正确引用元素a[i][j]的为() 。

A. *(a+j*n+i)

B. *(a+i*n+j)

C. *(*(a+i)+j)

D. *(*a+i)+j

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346518.html
点击查看答案
阅读下列程序:
main( )
{ int n[3],i,j,k;
for(i=0;i〈3;i++〉 n[i]=0;
k=2;
for (i=0;i〈k;i++〉
for (j=0;j〈k;j++〉 n[j]=n[i]+1;
printf("%d\n",n[1]); }
程序运行后输出结果是()。

A. 2

B. 1

C. 0

D. 3

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