首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include <stdio.h> main() { char a=3, b=6, c; c=(a^b)<<2; printf("%d \n", c ); } 程序运行后的输出结果是
有以下程序 #include <stdio.h> main() { char a=3, b=6, c; c=(a^b)<<2; printf("%d \n", c ); } 程序运行后的输出结果是
admin
2020-07-28
23
问题
有以下程序
#include <stdio.h>
main()
{ char a=3, b=6, c;
c=(a^b)<<2;
printf("%d \n", c );
}
程序运行后的输出结果是
选项
A、5
B、1
C、20
D、18
答案
C
解析
^运算符为按位异或运算符,即0^1=1,1^0=1,1^1=0,0^0=0,因此a^b=101
在进行<<操作,变为101002=2010,因此答案为C选项。
转载请注明原文地址:https://kaotiyun.com/show/bJ3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
计算机能直接执行的程序是
以下叙述中正确的是
以下叙述中错误的是
下列定义变量的语句中错误的是
有以下程序main(){inta[5]={2,4,6,8,10},*p,*k;p=a:k=&p;printf("%d",*(p++));printf("%d\n",**k);}程序运行后的输出结果是
设文件指针fp已定义,执行语句fp=fopen("file","w”);后,以下针对文本文件file操作叙述的选项中正确的是
面向对象方法中,继承是指
以下选项中,与n=i++完全等价的表达式是()。
下列关于数据库设计的叙述中,正确的是()。
随机试题
使f(x,y)=在点(0,0)处连续,应补充定义f(0,0)()
关于我国当前个体经济理解不正确的是()。
法洛四联征(tetralogyofFallot)包括:________,________,________,________。
小儿合理用氧一般要求保持PaO2在
下面哪项不应做会阴切开
牙槽骨吸收程度分三度,Ⅱ°吸收指
按照现行消费税制度的规定,纳税人外购下列已税消费品可以从应税销售额中扣除的有()。
1922年,甘地认为自己犯了“一个喜马拉雅山般的错误”,宣布停止“非暴力不合作”运动。他所说的“错误”是指他()。
Attentiontodetailissomethingeveryonecanandshoulddoespeciallyinatightjobmarket.BobCrossley,ahuman-resourcesex
Oncetheydecidedtohavechildren,MiShelandCarlMeissnertackledthenextbigissue:Shouldtheytrytohaveagirl?Itwas
最新回复
(
0
)