首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include<stdio.h> main() {int a=1,b=2,c=3,x; x=(a^b)&c; printf("%d\n",x); } 程序的运行结果是( )。
有以下程序: #include<stdio.h> main() {int a=1,b=2,c=3,x; x=(a^b)&c; printf("%d\n",x); } 程序的运行结果是( )。
admin
2019-08-10
23
问题
有以下程序:
#include<stdio.h>
main()
{int a=1,b=2,c=3,x;
x=(a^b)&c;
printf("%d\n",x);
}
程序的运行结果是( )。
选项
A、3
B、1
C、2
D、0
答案
A
解析
本题考查位运算符以及相关运算。^为按位或,&为按位与,那么a^b为3,再与c按位与仍然为3,所以答案为A选项。
转载请注明原文地址:https://kaotiyun.com/show/lcRp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列选项中属于面向对象设计方法主要特征的是( )。
if语句的基本形式是:if(表达式)语句,以下关于"表达式"值的叙述中正确的是
有以下程序#include#defineSUB(X,Y)(X+1)*Ymain(){inta=3,b=4;printf("%d\n",SUB(a++,b++));}程序运行后的输出结果是
有以下程序#includeintfun(intn){if(n==1)return1;elsereturn(n+fun(n-1));}main(){intx;scanf("%d",&x);x=fun(x);printf("%d\n
如果定义floata[10],x;则以下叙述中正确的是
以下选项中,合法的一组C语言数值常量是()。
设p是指针变量,语句p=NULL;等价于()。
给定程序中已建立一个带有头结点的单向链表,链表中的各结点按数据域递增有序链接。函数fun的功能是:删除链表中数据域值相同的结点,使之只保留一个。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生
已知学生的记录由学号和学习成绩构成,N名学生的数据已存入a结构体数组中。请编写函数fun,函数的功能是:找出成绩最低的学生记录,通过形参返回主函数(规定只有一个最低分)。注意:部分源程序存在文件PROG1.C文件中。请勿改动主函数ma
计算机高级语言程序的运行方法有编译执行和解释执行两种,以下叙述中正确的是
随机试题
对唾液腺作用描述错误的是
存款人开立单位银行结算账户,自正式开立之日起3个工作日后,才可使用该账户办理付款和收款业务。()
目前我国商业银行按照贷款余额()提取的贷款呆账准备金相当于普通准备金。
F公司拟投资一个新产品,有关资料如下:(1)预计该项目需要固定资产投资1800万元,可以持续5年,预计每年付现的固定成本为100万元,变动成本450元/件。固定资产折旧采用直线法,折旧年限为5年,估计净残值为100万元,税法规定的净残值为0。预计各年销
一根一米长的绳子有多少种用途?这是对()进行训练的题目。
所有喜欢数学的学生都喜欢哲学。如果上述信息正确,则下列哪项一定不正确?
有关研究发现,在肺癌患者中,有高达90%的建筑工人经常感受到来自工作和家庭的双重压力。王强是一名肺癌患者,而且他经常感受到来自各方面的压力,有时甚至有不堪负重的感觉,所以,王强很可能是一名建筑工人。以下哪项最准确地指出了上文推理中的错误?
支农惠农政策
Greenspacefacilities(设施)arecontributingtoanimportantdegreetothequalityofthecityenvironment.Fortunatelyitisno
WhichofthefollowingstatementsisTRUEaccordingtoPara.1?The1992LosAngelesriotsbrokeoutbecause________.
最新回复
(
0
)