首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 main(){ int a=1,b=2,c=3,x; X=(a^b)&c; printf("%d\n",x);} 程序的运行结果是
有以下程序 main(){ int a=1,b=2,c=3,x; X=(a^b)&c; printf("%d\n",x);} 程序的运行结果是
admin
2015-08-14
26
问题
有以下程序
main(){
int a=1,b=2,c=3,x;
X=(a^b)&c;
printf("%d\n",x);}
程序的运行结果是
选项
A、1
B、2
C、3
D、0
答案
C
解析
1、2、3的二进制形式分别为00000001、00000010、00000011。首先计算1与2的或运算,即1^2=(00000001)^(000000lO)=00000011,再将其与3进行“与”运算,结果为(00000011)&(00000011)=00000011,即十进制数3。
转载请注明原文地址:https://kaotiyun.com/show/cUDp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列程序的输出结果是()。#include<stdio.h>main(){charch[2][5]={"1234","5678"},*p[2];inti,j,s=0;for(i=0;
有下列函数定义:fun(floath){printf("%f,%f\n",h,h*h);}该函数的类型是()。
以下叙述中正确的是
两个或两个以上模块之间联系的紧密程度称为()
运行下列程序,若从键盘输入字母“a”,则输出结果是()。charc;c=getchar();if(c>=’a’&&c<=’g’)c=c+4;elseif(c>=’g’&&c<=’z’)c=c-21;
下列程序的执行结果是()。#include<stdio.h>main(){inta,b,c;a=b=2;c=(a++)-1;printf("%d,%d",a,c);c+=-a++
若函数调用时,参数为基本数据类型的变量,下列叙述中正确的是()。
在C语言中,函数的隐含存储类别是______。
以下叙述中错误的是
随机试题
关于牙周膜增龄变化描述哪项是错误的
肺源性心脏病急性发作期的主要治疗措施为
A、青蒿B、番泻叶C、麻黄D、广藿香E、薄荷晶鞘纤维
甲到乙医院做隆鼻手术效果很好。乙为了宣传,分别在美容前后对甲的鼻子进行拍照(仅见鼻子和嘴部),未经甲同意将照片发布到丙网站的广告中,介绍该照片时使用甲的真实姓名。丙网站在收到甲的异议后立即作了删除。下列哪一说法是正确的?(2011年卷三24题,单选)
某房地产开发商同时开发甲、乙、丙、丁四个小区,拟定销售价格分别为1500元/m2、900元/m2、2000元/m2和2400元/m2,此时四个小区的需求价格弹性系数分别为-1.23、-0.98、-1.36和-1.43,则可以判定()。
计算机中运算器的作用是()。
资产与权益的恒等关系是( )。
在具体运算阶段,儿童思维可逆性的标志是守恒观念的形成。()
为使每一个学生体验到成就感,在实际教学中,你认为下列哪些说法是正确的()。
立法是指有立法权的国家机关或经授权的国家机关,在法定的职权范围内依照程序,制定、补充、修改和废止法律和其他规范性法律文件的一项专门性活动。下列关于国家机关立法职能和权限说法正确的是()。
最新回复
(
0
)