现有如下程序段
#include "stdio.h"
main()
{ int k[30]={12,324,45,6,768,98,21,34,453,456};
int count=0,i=0;
while(k[i])
{ if(k[i]%2==0‖k[i]%5==0)count++;
i++; }
printf("%d,%d\n",count,i);}
则程序段的输出结果为
A.7,8
B.8,8
C.7,10
D.8,10
第1题
现有如下程序段
#include "stdio.h"
main()
{ int k[30]={12,324,45,6,768,98,21,34,453,456};
int count=0,i=0;
while(k[i])
{ if(k[i]%2==0‖k[i]%5==0)count++;
i++; }
printf("%d,%d\n",count,i);}
则程序段的输出结果为
A.7,8
B.8,8
C.7,10
D.8,10
第2题
现有如下程序段
#include "stdio.h"
int fun(int k,int *m)
{if(k%3)*m=k*k;
else *m=k/3;}
main()
{ int (*p)(int,int *),m;
p=fun;
(*p)(78, &m);
printf("%d\n",m);}
则程序段的输出结果为
A.24
B.25
C.26
D.27
第3题
现有如下程序段 #include"stdio.h" main() { int k[30]={12,324,45,6,768,98,21,34,453,456}; int count=0,i=0; while(k[i]) { if(k[i]%2==0‖k[i]%5==0)count++; i++; } printf("%d,%d\n",count,i);} 则程序段的输出结果为
A.7,8
B.8,8
C.7,10
D.8,10
第4题
现有如下程序段 #include"stdio.h" main() { int k[30]={12,324,45,6,768,98,21,34,453,456}; int count=0,i=0; while(k[i]) { if(k[i]%2==0||k[i]%5==0)count++; i++; } printf("%d,%d\n",count,i);} 则程序段的输出结果为
A.7,8
B.8,8
C.7,10
D.8,10
第5题
已知字符0的ASCII码为十六进制的30,现有程序如下: #include <stdio.h> main() { union{ unsigned char c; unsigned int i[4]; }z; z.i[0]=0x39; z.i[1]=0x36; printf("%c\n",z.c); } 此程序的输出结果是()。
A.6
B.9
C.0
D.3
第6题
现有如下程序段,此程序段编译有错误,则程序段的错误出在
#include
main()
{ int a=30,b=40,c=50,d;
d=a >30?b:c;
switch(d){case a:printf("%d,",a);
case b:printf("%d,",b);
case c:printf("%d,",c);
default:printf("#");}}
A.default:printf("#");这个语句
B.d=a>30?b:c;这个语句
C.case a:printf("%d,",a); case b:printf("%d,",b); case c:printf("%d,",c);这三个语句
D.switch(d)这个语句
第7题
现有如下程序段,此程序段编译有错误,则程序段的错误出在 #include<stdio.h> main() { int a=30,b=40,c=50,d; d=a>30? b:c; swish(d) { case a: Printf("%d,",a); case b: printf("%d,",b); case c: printf("%d,",c); default printf("#");}}
A.default:printf("#");这个语句
B.d=a>30? b:c;这个语句
C.case a:printf("%d,",a);case b:printf("%d,",b);case c:printf("%d,",c);这三个语句
D.switch(d)这个语句
第8题
A.7,8
B.8,8
C.7,10
D.8,10
第9题
A.7,8
B.8,8
C.7,10
D.8,10
第10题
A.7,8
B.8,8
C.7,10
D.8,10
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!