首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列语句中,在字符串s1和s2相等时显示"they are Equal"的是( )。
下列语句中,在字符串s1和s2相等时显示"they are Equal"的是( )。
admin
2010-12-10
28
问题
下列语句中,在字符串s1和s2相等时显示"they are Equal"的是( )。
选项
A、if(*s1==*s2)
B、if(!strcmp(s1,s2)) puts("they are Equal"); puts("they are Equal");
C、if(s1==s2)
D、if(strcmp(s1,s2)) Puts("they are Equal"); puts("they are Equal");
答案
B
解析
字符串比较不能用两个等于号(=)来进行比较,应使用函数strcmp(s1,s2)来比较。函数 strcmp(s1,s2)的功能:当字符串s1和s2相等时,返回值为0。因此,当表达式!strcmp(s1,s2)=1时,条件成立,执行后面的语句,输出they are Equal。
转载请注明原文地址:https://jikaoti.com/ti/L5B0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
在考生文件夹下有一个工程文件sjt5.vbp。其窗体中有一个名称为Textl的文本框数组,下标从0开始。程序运行时,单击“产生随机数”按钮,就会产生10个3位数的随机数,并放入Textl数组中,如图3-115(a)所示;单击“重排数据”按钮,将把Text1
设窗体上有一个名称为List1的列表框和一个名称为Check1的复选框数组(下标从0开始)。程序运行时,单击某个复选框,如果列表框中没有该复选框的标题,则把该复选框的标题添加到列表框中,否则从列表框中把该复选框标题删除。PrivateSubCheck
标准模块中有如下程序代码:PublicxAsInteger,yAsIntegerSubvar_pub() x=10∶y=20EndSub在窗体上有1个命令按钮,并有如下事件过程:PrivateSubCommand1_Clic
关于KeyPress事件,以下叙述中正确的是( )。
在软件开发中,需求分析阶段可以使用的工具是( )。
(1)学生文件夹下的工程文件sjt3.vbp中有一个初始内容为空、且带有垂直滚动条的文本框,其名称为Text1:两个标题分别为“读数据”和“查找”的命令按钮,其名称分别为Cmd1、Cmd2。请画一个标题为“查找结果”的标签Labet1,再画一个名称为Tex
在窗体上有一个文本框Textl和一个标签Labell,要求运行程序时,在文本框中输入的内容立即显示在标签中(如图1所示),则空白处应填入的内容是()。PrivateSubTextl________()Label1.Cap
下列不一定是传值的虚实结合方式的选项是()。
深度为5的完全二叉树的结点数不可能是
在一棵二叉树上,第5层的结点数最多是()。
随机试题
能引起听觉的声波振动频率是()。
目前认为99mTc-MIBI进入心肌细胞后,主要分布于
男性,25岁。因高位小肠瘘1天人院,人院后经颈内静脉插管滴人肠外营养液,两周后突然出现寒战、高热,无咳嗽、咳痰,腹部无压痛和反跳痛。
国际项目管理资质标准(ICB)要求国际项目管理人员必须具备的专业知识和技能主要包括()
所有的恐龙都是腿部直立地“站在”地面上的,这不同于冷血爬行动物四肢趴伏在地面上;恐龙的骨组织构造与温血哺乳动物的骨组织构造相似;恐龙的肺部结构和温血动物非常相近;在现代的生态系统中(例如非洲草原),温血的捕食者(例如狮子)与被捕食者(例如羚羊)之间的比值是
1,4,16,49,121,()
Thebeliefthattheuniverseisimprovingandthatgoodwill______triumphoverevilprevails.
It’shardtobelievethatDr.JudahFolkman,thepioneeringcancerresearcherwhosuccumbedtoaheartattackonMondayatthea
A、7hours.B、14hours.C、10hours.D、8hours.DW:WhenisthelibraryopenonSunday?M:From9a.m.to5p.m.Q:Howlongisth
壮观的
最新回复
(
0
)