首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
若有以下程序 #include<stdio.h> main(){int b=10,a=-11; a%=b%=4: printf("%d%d\n",a,b);} 则程序的输出结果是
若有以下程序 #include<stdio.h> main(){int b=10,a=-11; a%=b%=4: printf("%d%d\n",a,b);} 则程序的输出结果是
admin
2019-05-17
57
问题
若有以下程序
#include<stdio.h>
main(){int b=10,a=-11;
a%=b%=4:
printf("%d%d\n",a,b);}
则程序的输出结果是
选项
A、1 2
B、-1÷2
C、-12
D、1-2
答案
C
解析
对于表达式a%=b%=4为复合的赋值运算,结合性自右至左,相当于先计算b=b%4,a=a%b;结果的符号和第一个操作数的符号相同,因此b为2,a的结果为-1。
转载请注明原文地址:https://kaotiyun.com/show/pHRp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序:#include<stdio.h>intfun(){staticintx=1;x+=1;returnx;}main(){inti,s=1;for(i=
以下不构成无限循环的语句或语句组是
按照C语言规定的用户标识符命名规则,不能出现在标识符中的是
有以下程序#includevoidfun(char**P、{++p;printf("%sha",*p);)main(){char*a[]=("Morning","Afternoon","Evening
有以下程序段int*p;p=_________malloc(sizeof(int));若要求使p指向一个int型的动态存储单元,在横线处应填入的是
若a是数值类型,则逻辑表达式(a==1)‖(a!=1)的值是
在C语言中,只有在使用时才占用内存单元的变量,其存储类型是
C语言程序中,运算对象必须是整型数的运算符是
下面不属于软件开发阶段任务的是()。
下面属于系统软件的是()。
随机试题
《声声慢》是一首慢词,婉约词,是作者前期词的代表作品。()
下列情况中,交割仓库应承担赔偿责任的有()。
1689年《权利法案》颁布的主要意义在于()。
如果你打算拍一部以18世纪的英国为背景的影片,下列不可能在影片中出现的情景是()。
AftertheWarofIndependence,Americansdesignedanewsystem.Whatit?
Therearevariouswaysinwhichindividualeconomicunitscaninteractwithoneanother.Threebasicwaysmaybedescribedasth
A、Stomachcancer.B、Skincancer.C、Lungcancer.D、Bloodcancer.AA是老师提到阳光可以防御癌症后列举的例子之一。B是曝晒导致的。
A、Seeifhequalifiesforastudentloan.B、Makeaproposaltothegovernment.C、Starttosaveuptopayforhiskidstogotos
FootballandMoneyWhywasitfootball,ratherthantheothergreatVictoriansports,thatcapturedtheworld?Onereasonma
A、Whethertoaccepthisboss’sjoboffer.B、Whethertoapplytotransfertoanotherplace.C、Whethertofindanewjob.D、Whethe
最新回复
(
0
)