首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include main() { int x[3][2]={0},i; for(i=0;i
有以下程序: #include main() { int x[3][2]={0},i; for(i=0;i
admin
2017-11-06
52
问题
有以下程序:
#include
main()
{
int x[3][2]={0},i;
for(i=0;i<3;i++)
scanf(“%d”,x
);
printf(“%3d%3d%3d\n”,x[0][0],x[0][1],x[1][0]);
}
若运行时输入:2 4 6<回车>,则程序的运行结果为( )。
选项
A、2 0 4
B、2 0 0
C、2 4 0
D、2 4 6
答案
A
解析
本题中输人的3个数据2、4、6分别赋值给了x[0][0]、x[1][0]、x[2][0]。x[0][1]仍为初始时的0,所以打印输出时的结果为A选项。
转载请注明原文地址:https://kaotiyun.com/show/sBxp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
若有以下程序段:structst{intn;int*m:};inta=2,b=3,c=5;structsts[3]=({101,&a},{102,&c},{103,&B)};main()
以下关于long、int和short类型数据占用内存大小的叙述中正确的是()。
有以下程序:main(){charch[]="uvwxyz",*pc;pc=ch;printf("%c\n",*(pc+5));}程序运行后的输出结果是()。
有以下程序段:intn,t=1,S=0;scanf("%d",&n);do{s=s+t;t=t-2;}while(t!=n);为使此程序段不陷入死循环,从键盘输入的数据应该是()。
以下程序运行后的输出结果是()。fun(intA){intb=0;staticintc=3;b++;c++;return(a+b+C);}main(){inti,a=5;
以下程序中,fun函数的功能是求3行4列二维数组每行元素中的最大值,请填空:voidfun(int,int,int(*)[4],int*);main(){inta[3][4]={{12,41,36,28},{19,33,15
已有定义:double*P;,请写出完整的语句,利用malloc函数使p指向一个双精度型的动态存储单元()。
若有语句:char*line[5];,以下叙述中正确的是()。
若有函数voidfun(doublea[],int*n){……}以下叙述中正确的是
已知下列函数定义:fun(int*b,intc,intn,intdata){irak;for(k=0;k
随机试题
综合商社被人们认为是以_______为主导的跨国公司。()
A、afternoonB、classroomC、roommateD、bootBA、C、D三项的划线部分发长音[u:],而B项发短音[u],因此选B项。
Forthepastseveralyears,theSundaynewspapersupplementParadehasfeaturedacolumncalled"AskMarilyn."Peopleareinvite
有关工程进度曲线论述正确的有()。
根据管理运作方式,下列属于商业银行个人理财业务的有()。
3,2,11,14,27,()
Aneweconomicspaperhassomeold-fashionedadviceforpeoplenavigatingthestressesoflife:Findaspousewhoisalsoyourb
ItseemstomethatthetimeisripefortheDepartmentofEmploymentandtheDepartmentofEducationtogettogetherwiththeu
窗体上有名称为Listl的列表框。以下能够将列表框当前选定的列表项替换为字符串“Basic”的语句是
A、Placesthemanhasvisited.B、Apaperthewomaniswritingforaclass.C、Schoolactivitiestheyenjoy.D、Thewoman’splansfo
最新回复
(
0
)