APP下载
首页
>
IT互联网
>
信息技术知识竞赛c语言
搜索
信息技术知识竞赛c语言
题目内容
(
单选题
)
有以下程序
int fun(int x[],int n)
{static int sum=0,i;
for(i=0;i<n;i++) sum+=x[i];
return sum;
}
main()
{int a[]={1,2,3,4,5},b[]={6,7,8,9},s=0;
s=fun(a,5)+fun(b,4);printf("%d\n",s);
}
程序执行后的输出结果是()。

A、45

B、50

C、60

D、55

答案:C

信息技术知识竞赛c语言
写出下列程序段运行结果()。
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
点击查看题目
有以下程序
int add(int a,int b){return+b};}
main()
{int k,(*f)(),a=5,b=10;
f=add;
... }则以下函数调用语句错误的是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346504.html
点击查看题目
若有以下程序片段:
char str[ ]="ab\n\012\\\"";
printf("%d",strlen(str));
上面程序片段的输出结果是 ( )。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346520.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
点击查看题目
有以下程序
  struct stu
  { int num;
  char name[10];
  int age;
  };
  void fun(struct stu *p)
  { printf("%s\n",(*p).name); }
  main()
  {
  struct stu students[3]={{9801,"Zhang",20},
  {9802,"Wang",19},
  {9803,"Zhao",18} };
  fun(students+2);
  }
  输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346505.html
点击查看题目
设fp为指向某二进制文件的指针,且已读到此文件末尾,则函数feof(fp)的返回值为()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346500.html
点击查看题目
设有如下程序:
#include
main()
{ int **k, *j, i=100;
j=&i; k=&j;
printf("%d\n", **k);
}
上面程序的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346518.html
点击查看题目
有以下程序
main()
{int i,s=0,t[]={l,2,3,4,5,6,7,8,9};
for(i=0;i<9;i+=2)s+=*(t+i);
printf("%d\n",s);
}
程序执行后的输出结果是()。
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346514.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
点击查看题目
以下对结构体变量stu1中成员age的非法引用是()。
struct student
{ char name[10];
int age ;
} stu1 ,*p; p=&stu1;
https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-4d08-c089-2897e034650c.html
点击查看题目
首页
>
IT互联网
>
信息技术知识竞赛c语言
题目内容
(
单选题
)
手机预览
信息技术知识竞赛c语言

有以下程序
int fun(int x[],int n)
{static int sum=0,i;
for(i=0;i<n;i++) sum+=x[i];
return sum;
}
main()
{int a[]={1,2,3,4,5},b[]={6,7,8,9},s=0;
s=fun(a,5)+fun(b,4);printf("%d\n",s);
}
程序执行后的输出结果是()。

A、45

B、50

C、60

D、55

答案:C

信息技术知识竞赛c语言
相关题目
写出下列程序段运行结果()。
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
点击查看答案
有以下程序
int add(int a,int b){return+b};}
main()
{int k,(*f)(),a=5,b=10;
f=add;
... }则以下函数调用语句错误的是()。

A. k=(*f)(a,b);

B. k=add(a,b);

C. k=*f(a,b);

D. k=f(a,b);

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-5ca8-c089-2897e0346504.html
点击查看答案
若有以下程序片段:
char str[ ]="ab\n\012\\\"";
printf("%d",strlen(str));
上面程序片段的输出结果是 ( )。

A. 3

B. 4

C. 6

D. 12

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346520.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
点击查看答案
有以下程序
  struct stu
  { int num;
  char name[10];
  int age;
  };
  void fun(struct stu *p)
  { printf("%s\n",(*p).name); }
  main()
  {
  struct stu students[3]={{9801,"Zhang",20},
  {9802,"Wang",19},
  {9803,"Zhao",18} };
  fun(students+2);
  }
  输出结果是()。

A. Zhang

B. Zhao

C. Wang

D. 18

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346505.html
点击查看答案
设fp为指向某二进制文件的指针,且已读到此文件末尾,则函数feof(fp)的返回值为()。

A. EOF

B. 非0值

C. 0

D. NULL

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-50f0-c089-2897e0346500.html
点击查看答案
设有如下程序:
#include
main()
{ int **k, *j, i=100;
j=&i; k=&j;
printf("%d\n", **k);
}
上面程序的输出结果是()。

A. 运行错误

B. 100

C. i的地址

D. j的地址

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-6090-c089-2897e0346518.html
点击查看答案
有以下程序
main()
{int i,s=0,t[]={l,2,3,4,5,6,7,8,9};
for(i=0;i<9;i+=2)s+=*(t+i);
printf("%d\n",s);
}
程序执行后的输出结果是()。

A. 45

B. 20

C. 25

D. 36

https://www.shititong.cn/cha-kan/shiti/0005eb65-536a-58c0-c089-2897e0346514.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
点击查看答案
以下对结构体变量stu1中成员age的非法引用是()。
struct student
{ char name[10];
int age ;
} stu1 ,*p; p=&stu1;

A. stu1.age

B. p->age

C. (*p).age

D. student.age

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