APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
以下程序运行后的输出结果是( )。
  #include
  main()
  { int i,n[5]={0};
  for(i=1;i<=4;i++)
  { n[i]=n[i-1]*2+1; printf("%d",n[i]); }
  printf("\n");
  }

A、13715

B、13716

C、13717

D、13714

答案:A

信息技术知识竞赛c语言
有以下程序
  #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
点击查看题目
下列函数的功能是
fun(char * a,char * b)
{ while((*b=*a)!='\0') {a++,b++;} }
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e034651c.html
点击查看题目
有以下程序
main()
{int a=1,b=3,c=5;
int *p1=&a,*p2=&b,*p=&c;
*p=*p1*(*p2);
printf("%d\n",c);
}
执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346500.html
点击查看题目
设有如下函数定义:
int f(char *s)
{ char *p=s;
while(*p!='\0') p++;
return(p-s); }
如果在主程序中用下面的语句调用上述函数,则输出结果为()。
printf("%d\n",f("goodbey!"));
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034650e.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
点击查看题目
以下语句中存在语法错误的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650a.html
点击查看题目
若有说明:int a[10];则对a 数组元素的正确引用是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e0346504.html
点击查看题目
对下面程序段:
#define A 3
#define B(a) ((A+1)*a)
...
x=3*(A+B(7));正确的判断是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346501.html
点击查看题目
以下程序输出结果是()。       
main()
{ int m=5;
if(m++>5) printf("%d\n",m);
esle printf("%d\n",m- -);
}
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4920-c089-2897e034650e.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
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

以下程序运行后的输出结果是( )。
  #include
  main()
  { int i,n[5]={0};
  for(i=1;i<=4;i++)
  { n[i]=n[i-1]*2+1; printf("%d",n[i]); }
  printf("\n");
  }

A、13715

B、13716

C、13717

D、13714

答案:A

信息技术知识竞赛c语言
相关题目
有以下程序
  #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
点击查看答案
下列函数的功能是
fun(char * a,char * b)
{ while((*b=*a)!='\0') {a++,b++;} }

A. 将a所指字符串赋给b所指空间

B. 使指针b指向a所指字符串

C. 将a所指字符串和b所指字符串进行比较

D. 检查a和b所指字符串中是否有'\0'

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

A. 1

B. 2

C. 3

D. 4

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346500.html
点击查看答案
设有如下函数定义:
int f(char *s)
{ char *p=s;
while(*p!='\0') p++;
return(p-s); }
如果在主程序中用下面的语句调用上述函数,则输出结果为()。
printf("%d\n",f("goodbey!"));

A. 3

B. 6

C. 8

D. 0

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e034650e.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
点击查看答案
以下语句中存在语法错误的是()。

A. char ss[6][20];ss[1]= "right? ";

B. char ss[][20]={ "right? "};

C. char *ss[6];ss[1]= "right? ";

D. char *ss[]={"right? "};

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e034650a.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
点击查看答案
对下面程序段:
#define A 3
#define B(a) ((A+1)*a)
...
x=3*(A+B(7));正确的判断是()。

A. 程序错误,不许嵌套宏定义

B. 程序错误,宏定义不许有参数

C. x=93

D. x=21

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346501.html
点击查看答案
以下程序输出结果是()。       
main()
{ int m=5;
if(m++>5) printf("%d\n",m);
esle printf("%d\n",m- -);
}

A. 7

B. 6

C. 5

D. 4

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