首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include main() { int a=5,b=1,t; t=(a
有以下程序 #include main() { int a=5,b=1,t; t=(a
admin
2020-11-23
40
问题
有以下程序
#include
main()
{ int a=5,b=1,t;
t=(a<<2)|b;printf("%d\n",t);
}
选项
A、11
B、6
C、21
D、1
答案
C
解析
本题考查位操作运算符。
‘<<’是左移运算符,左移一位相当于乘2,‘|’是按位或运算符。5左移两位相当于乘4,得到20,20的二进制数是00010100,和0000000l进行按位或操作得到00010101,即十进制的21。
转载请注明原文地址:https://kaotiyun.com/show/yN3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序:#includemain(){inta1,a2;charc1,c2;scanf("%d%c%d%c",&a1,&c1,&a2,&c2);pfinff("%d,%c,%d,%c",a1,c1,a2,c2);}若想通过
有以下程序:#includeintmul(intval){staticintinit=1;returninit*=val;}main(){inti;f
设有定义:intx=2;,以下表达式中,值不为6的是()。
设有如下语句:typedefstructDate{intyear;intmonth;intday;}DATE;则以下叙述中错误的是()。
以下选项中错误的是()。
若有以下定义和语句:#include<stdio.h>chars1[10]="abcd!",*s2="\n123\\";prinff("%d%d\n",strlen(s1),strlen(s2));则输出结果是()。
对于以下函数声明voidfun(intarray[4],int*ptr);以下叙述中正确的是()。
以下叙述中错误的是()。
下面描述中不属于数据库系统特点的是
关于数据库管理阶段的特点,下列说法中错误的是
随机试题
能治疗瘿瘤的药物有( )
猪,45日龄,做去势术,按照常规方法摘除睾丸后,处理切口的方式为
最美观的修复体是固位力最差的是
在下列各类市场中,属于生产要素市场的有()。
TheconceptcapturedtheZeitgeistofthepersonalcomputerrevolution.Manyyoungpeople,especiallythoseinthecountercultur
A=AudiA3B=HondaCivicC=Rover200D=ToyotaCamryHybridWhichcar...hasadriverseatthatcanbeadjustedtofitmo
Americansaregettingreadyforthebiggestsoccereventintheworld.Forthefirsttimetheworldcupsoccercompetitionwill
Wouldyouliketoknowifyourbodyisolderoryoungerthanitshouldbe?DrDavidWikenheiserhasbeenstudyingageinginVanc
ThecreationofUNwas,perhaps,themost______achievementofthe20thcentury.
Manyconsumeritemsarebeingredesignedaccordingtothenewstandardwhowillminimizetheirenvironmentalimpact.
最新回复
(
0
)