首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include main() { int i=0; i=~i; printf("%d\n",i); } 程序运行后的输出结果是( )。
有以下程序: #include main() { int i=0; i=~i; printf("%d\n",i); } 程序运行后的输出结果是( )。
admin
2020-04-18
50
问题
有以下程序:
#include
main()
{ int i=0;
i=~i;
printf("%d\n",i);
}
程序运行后的输出结果是( )。
选项
A、8
B、0
C、1
D、-1
答案
D
解析
本题考查按位取反运算。0按位取反就是-1,所以选项D正确。
转载请注明原文地址:https://kaotiyun.com/show/f3Cp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序#includeintflintx)main(){inty;{intz;if(x==0‖x==1)return(3);z=f(3);printf("%d\n",z
有以下函数intfun(char*s){char*t=s;while(*t++);return(t-s);}该函数的功能是
若有以下程序#includeintk=7;voidf(int**s){int*t=&k;*s=t:printf("%d,%d,%d,",k,*t,**s);}main(){inti=3,
以下叙述中正确的是
有以下程序#includemain()voidfun(inta,intb){intc[10]={1,2,3,4,5,6,7,8,9,0),i;{intt;for(i=0;i
有以下程序voidfun2(chara,charb)main(){printf("%c%c",a,b);}{fun1();chara=’A’,b=’B’;printf("%c%c",a,b);
在函数调用过程中,如果函数如funA调用函数funB,函数funB又调用了函数如funA,则
有以下程序#include#includestructA{inta;charb[10];doublec;};voidf(structAt);main(){structA
有以下程序段structst{intx;int*y;}*pt;inta[]={1,2},b[]={3,4};structstc[2]={10,a,20,b}:pt=c;以下选项中表达式的值为11
以下程序依次把从终端输入的字符存放到f文件中,用#作为结束输入的标志,则在横线处应填入的选项是#includemain(){FILE*fp;charch;fp=fopen("fname","w");whi
随机试题
我国对外出口商品一批,报价CIF纽约,发票总额为23500美元,若按发票金额110%投保一切险和战争险,一切险和战争险费率分别为0.6%和0.4%。试计算这笔业务的投保金额和保险费各为多少?(写出计算公式和过程)
慢性闭角型青光眼形态学诊断应选择
以下关于质量记录填写要求描述中错误的是
亚硝酸钠滴定法测定盐酸普鲁卡因含量时,1ml的亚硝酸钠滴定液(0.1mol/L)相当于盐酸普鲁卡因的量是(盐酸普鲁卡因的分子量为272.77)非水滴定法测定盐酸丁卡因含量时,每1ml高氯酸滴定液(0.1mol/L)相当于盐酸丁卡因的量是(盐酸丁卡因的分
自然保护区
文字:编辑( )
1,10,7,10,19,()
Itwastwoyearsagotodaythatthehuntingbancameintoforce,supposedlyendingcenturiesoftradition.However,thelawhas
PassiveSmokingIsWorkplaceKillerPressuremountedonBritainonMondaytotakeactionon(51)smokingwithnewresearchs
ThehistoryofAfrican—Americansduringthepast4-00yearsistraditionallynarrated【1】anongoingstruggleagainst【2】andindiff
最新回复
(
0
)