首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下述语句中,在字符串s1和s2相等时显示“they are Equal”的是( )。
下述语句中,在字符串s1和s2相等时显示“they are Equal”的是( )。
admin
2013-02-23
20
问题
下述语句中,在字符串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)函数,字符串s1和s2相等时返回值为0,故!strcmp(s1,s2)==1,条件成立执行后面的语句,输出they are Equak
转载请注明原文地址:https://kaotiyun.com/show/VBJp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下述程序向文件输出的结果是______。#include<stdio.h>voidmain(){FILE*fp=fopen("TESY","wb");fprintf(fp,"%d%5.0f%c%d",58,7
以下程序(程序左边的数字为附加的行号)______。1#include<str.h>2#include<stdio.h>3main()4{chars[]="string";5puts(s);6
设a、b和c都是int型变量,且a=3,b=4,c=5,则下列值为0的表达式是()
注释说明了程序的功能,它分为【】注释和功能性注释。
若有定义inta=10,b=9,c=8;,接着顺序执行下列语句,变量b中的值是【】。c=(a-=(b-5));c=(a%11)+(b=3);
下列叙述中,正确的一条是______。
数据模型是数据库系统中用于提供信息表示和操作手段的结构形式。实际数据库系统中所支持的数据模型主要有层次模型、网状模型和【】3种。
开发软件所需要的高成本和产品的低质量之间有着尖锐的矛盾,这种现象被人们称之为【】。
以下选项中,不能确定赋值的是______。
以下程序的功能是:对输入的一行字符串的数字字符按它们的字面值累加,输出此累加和。例如,输入一行字符是:ab34dh8u,输出值应当是15。请填空。#include<stdio.h>#include<ctype.h>m
随机试题
学前儿童绘画、写字的持续时间不宜超过5~10分钟。()
内伤发热的一般特点是( )
有关分裂样人格障碍的说法,正确的是
关于保险公司中发生的侵占行为,下列哪些说法正确?
施工现场混凝土坍落度试验属于现场质量检查方法中的( )。
()是国内商业银行竞相发展的零售银行业务。
项目的完成和人员工作热情、积极性的保持,必须有一套合理、科学的________作为支柱和保障。
"Isn’ttheTVplaywonderful?"Thissentencemeans______.
中国第四大淡水湖(),既是淮河流域大型水库、航运枢纽,又是渔业、特产品、禽备产品的生产基地,素有“日出斗金”的美誉。
WhatdoesNancythinkofhernewneighbors?
最新回复
(
0
)