首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下述语句中,在字符串s1和s2相等时显示“they are Equal”的是( )。
下述语句中,在字符串s1和s2相等时显示“they are Equal”的是( )。
admin
2020-06-16
30
问题
下述语句中,在字符串s1和s2相等时显示“they are Equal”的是( )。
选项
A、if(*s1==*s2)
puts(“they are Equal”);
B、if(!strcmp(s1,s2))
puts(“they are Equal”);
C、if(s1==s2)
Puts(“they are Equal”);
D、if(strcmp(s1,s2))
puts(“they are Equal”);
答案
B
解析
字符串比较小能用两个等号(==)来进行比较,应使用strcmp(s1,s2)函数来比较。strcmp(s1,s2)函数的功能是:当字符串s1和s2相等时,返回值为0,因此,当表达式!strcmp(s1,s2)==1时,条件成立,执行后面的语句,输出they are Equal。
转载请注明原文地址:https://kaotiyun.com/show/8iCp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
有以下程序#includedoublef(doublex);main()doublef(doublex){doublea=0;inti;{returnx*x+1;}for(i=0;i
若k是int类型变量,且有以下for语句1for(k=-1;k
计算机高级语言程序的运行方法有编译执行和解释执行两种,以下叙述中正确的是
以下选项中,能正确进行字符串赋值的是
占构化程序设计原则强调的是
耦合性和内聚性是对模块独立性度量的两个标准。下列叙述中正确的是()。
请编函数fun,其功能是将一个数字字符串转换成与其面值相同的长整型整数。可调用strlen函数求字符串的长度。例如,在键盘输入字符串2345210,函数返回长整型数2345210。注意:请勿改动主函数main和其他函数中的任何内容,仅在函数fun
下列选项中不属于结构化程序设计原则的是()。
使用白盒测试方法时,设计测试用例应根据()。
随机试题
I’djustassoonremind______thoseimportantdocumentswithyou.
关于急腹症摄影的叙述,错误的是
A.风气内动B.寒从中生C.湿浊内生D.津伤化燥E.火热内生
水利系统文明建设工地安全管理标准有()。
黄山公司将用于新建投资项目的专门借款进行暂时性投资取得的投资收益为( )元。假设借款费用资本化金额按实际投入资金比例在设备和建筑物之间进行分配,则黄山公司20×7年12月末新建投资项目验收合格的设备部分的入账价值为( )元。
甲卷烟厂和其客户乙卷烟批发公司均为增值税一般纳税人。甲卷烟厂生产的A牌卷烟不含税调拨价为120元/标准条。2013年3月,甲卷烟厂和乙卷烟批发公司有关生产经营情况如下:(1)甲卷烟厂:从烟丝生产企业购进烟丝,取得增值税专用发票,注明价款140万元、增
社会工作者在对小学二年级凌凌开展的个案辅导中发现,凌凌的手臂及背部有多处淤青,并且步态有些怪异,此时,社会工作者的首要任务是()。
班级组织建构的首要原则是()。
【2015湖北荆门】马克思主义关于_______学说,确定了科学的人的发展观,揭示了人的发展的必然规律,对于研究人的发展,确定教育目的有极其重要的意义。
Whatisspecialaboutthetreasures?WhathasUNESCOdonetoprotectthesetreasures?
最新回复
(
0
)