APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
下列程序的输出结果是()。
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

答案:B

信息技术知识竞赛c语言
在嵌套使用if语句时,C语言规定else总是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346508.html
点击查看题目
有以下程序
#include
void main( )
{ int a=1,*p,**pp;
pp=&p;
p=&a;
a++;
printf ("%d,%d,%d\n", a,*p, **pp);
}
执行后的输出结果是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6860-c089-2897e034651f.html
点击查看题目
有以下程序
  #include
  struct S
  { int a,b;}data[2]={10,100,20,200};
  main()
  { struct S p=data[1];
  printf("%d\n",++(p.a));
  }
  程序运行后的输出结果是()。   
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346503.html
点击查看题目
有以下程序
  #include
  int fun()
  { static int x=1;
  x*=2;
  return x;
  }
  main()
  { int i,s=1;
  for(i=1;i<=3;i++) s*=fun();
  printf("%d\n",s);
  }
  程序运行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346500.html
点击查看题目
以下程序运行后,输出结果是 ()。
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);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034651e.html
点击查看题目
有以下程序
fun(int x,int y){return(x+y);}
main()
{int a=1,b=2,c=3,sum;
sum=fun((a++,b++,a+b),c++);
printf("%d\n",sum); }
执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651c.html
点击查看题目
以下函数的功能是:通过键盘输入数据,为数组中的所有元素赋值。
  #include
  #define N 10
  void fun(int x[N])
  { int i=0;
   while (i scanf("%d",______);
  }
  在程序中下划线处应填入的是( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346520.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
点击查看题目
若有说明:int a[10];则对a 数组元素的正确引用是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346504.html
点击查看题目
下列程序段的执行结果是输出( )。
x=3;
do

printf("%2d",x--);
} while(!x);
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-54d8-c089-2897e0346520.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

下列程序的输出结果是()。
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

答案:B

信息技术知识竞赛c语言
相关题目
在嵌套使用if语句时,C语言规定else总是()。

A. 和之前与其具有相同缩进位置的if配对

B. 和之前与其最近的if配对

C. 和之前与其最近的且不带else的if配对

D. 和之前的第一个if配对

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

A. 2,1,1

B. 2,1,2

C. 2,2,2

D. 1,1,1

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

A. 10

B. 11

C. 20

D. 21

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346503.html
点击查看答案
有以下程序
  #include
  int fun()
  { static int x=1;
  x*=2;
  return x;
  }
  main()
  { int i,s=1;
  for(i=1;i<=3;i++) s*=fun();
  printf("%d\n",s);
  }
  程序运行后的输出结果是()。

A. 0

B. 10

C. 30

D. 64

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6478-c089-2897e0346500.html
点击查看答案
以下程序运行后,输出结果是 ()。
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

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034651e.html
点击查看答案
有以下程序
fun(int x,int y){return(x+y);}
main()
{int a=1,b=2,c=3,sum;
sum=fun((a++,b++,a+b),c++);
printf("%d\n",sum); }
执行后的输出结果是()。

A. 6

B. 7

C. 8

D. 9

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e034651c.html
点击查看答案
以下函数的功能是:通过键盘输入数据,为数组中的所有元素赋值。
  #include
  #define N 10
  void fun(int x[N])
  { int i=0;
   while (i scanf("%d",______);
  }
  在程序中下划线处应填入的是( )。

A. x+i

B. &x[i+1] 

C.  x+(i++)

D. &x[++i]

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346520.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
点击查看答案
若有说明:int a[10];则对a 数组元素的正确引用是()。

A. a[10]

B. a[3.5]

C. a(5)

D. a[10-10]

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346504.html
点击查看答案
下列程序段的执行结果是输出( )。
x=3;
do

printf("%2d",x--);
} while(!x);

A. 3 2 1

B. 3

C. 2 1

D. 2 1 0

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