首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下列语句中,在字符串s1和s2相等时显示"they are Equal"的是( )。
下列语句中,在字符串s1和s2相等时显示"they are Equal"的是( )。
admin
2010-12-10
25
问题
下列语句中,在字符串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://kaotiyun.com/show/V6Pp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
在关系数据库中,用来表示实体间联系的是
有如下通用过程:PrivateSubSt(ByValstrXAsString,strYAsString)DimTsAsStringi=Len(strX)DoWhilei>=1
有下面程序代码:PrivateSubCommand1_Click()Fork=5To1Step-1x=k+x*10NextkPrintxEndSub程序运行后,单击命
(1)在考生文件夹下有一个工程文件sjt3.vbp,相应的窗体文件为sjt3.frm。其功能是随机产生30个0~1000的整数,放入一个数组中,然后输出其中的最小值。程序运行后,单击命令按钮(名称为Command1,标题为“输出最小值”),即可求出其最小值
以下事件过程的功能是:从已存在于磁盘上的顺序文件Numl.txt中读取数据,计算读出数据的平方值,将该数据及其平方值存入新的顺序文件Nurn2.txt中。则在以下横线处合适的语句是()。PrivateSubForm_Click()Dim文A
设窗体上有一个名称为Textl的文本框,程序运行时,要求该文本框不能接受键盘输入,但能输出信息,以下属性设置正确的是()。
对长度为n的线性表排序,在最坏情况下,比较次数不是n(n-1)/2的排序方法是( )。
软件设计中模块划分应遵循的准则是
在软件开发中,需求分析阶段产生的主要文档是( )。
程序流程图中带有箭头的线段表示的是( )。
随机试题
IUD适用于哪些育龄妇女?
建设一种民族共同语涉及推广和_______两方面的工作。
甲亢的临床表现______。
患儿,2岁2个月。高热3天,持续不退,口唇发绀,气促,喉间痰鸣,烦躁不安,忽见神昏谵语,双目上视,四肢抽搐,舌红,苔黄,指纹青紫,可达命关。治疗宜首选
矿井平巷运输时,符合安全规程要求的是()。
某技术方案建设期为3年。建设期间共向银行贷款1500万元,其中第1年初贷款1000万元,第2年初贷款500万元;贷款年利率6%,复利计息。则该技术方案的贷款在建设期末的终值为()万元。
“备案号”栏:()。“成交方式”栏:()。
下列争议中,可以提出行政复议的有()。
下列犯罪中,属于真正身份犯的是()。
行列式=_____________________________
最新回复
(
0
)