首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
对下述程序的判断中,正确的是( )。 #include<stdio.h> void main() {char *P,s[256]; p=s; while(strcmp(s,"the end")) {printf("
对下述程序的判断中,正确的是( )。 #include<stdio.h> void main() {char *P,s[256]; p=s; while(strcmp(s,"the end")) {printf("
admin
2013-06-11
41
问题
对下述程序的判断中,正确的是( )。 #include<stdio.h> void main() {char *P,s[256]; p=s; while(strcmp(s,"the end")) {printf("Input the string:"); gets(s); while(*P) putchar(*p++);}}
选项
A、此程序循环接收字符串并输出,直到接收到字符串“the end”为止
B、此程序循环接收字符串,接收到字符串“the end”则输出,否则程序终止
C、此程序循环接收字符串并输出,直到接收字符串“the end”为止,但因为代码有错误,程序不能正常工作
D、此程序循环接收字符串并将其连接在一起,直到接收字符串“the end”为止,输出连接在一起的字符串
答案
A
解析
strcmp(str1,str2)是比较字符串str1和sir2,当两字符串相等时,返回值为0,不相等时返回值为非0;所以此段程序的功能是在未接收到字符串“the end”时,读入字符并输出。
转载请注明原文地址:https://jikaoti.com/ti/dtn0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下面程序的运行结果是:【】。typedefunionstudent{charname[10];longsno;charsex;floatscore[4];}STU;mai
下面程序的输出是______。main(){intx=3,y=6,a=0;while(x++!=y-=1)){a+=1;if(y<x)break;}print
设a、b和c都是int型变量,且a=3、b=4、c=5,则下面的表达式中,值为0的表达式是______。
程序设计是以()和数据结构为基础的。
下列叙述中正确的是()
以下程序通过函数sunFun求f(x)。这里f(x)=x2+1,由F函数实现。请填空。main(){printf("Thesum=%d\n",SunFun(10));}SunFun(intn){int
一个项目具有一个项目主管,一个项目主管可管理多个项目,则实体“项目主管”与实体“项目”的联系属于______的联系。
评价排序算法优劣的主要标准是______和______。
串的长度是______。
下列选项中非法的字符常量是()。
随机试题
货箱前部挂钩突出货箱外侧面不得超过30mm。()
将十进制的整数化为N进制整数的方法是()。
正常成人的QRS波群时限多为
受精是指精子和卵子相融合形成受精卵的过程。受精部位在()。
A.清热解毒、凉血B.清热解毒、利咽C.清热解毒、息风止痉D.清热解毒、止痢E.清热解毒、明目大青叶、板蓝根、青黛共同具有的作用()
住户F拟申请个人住房贷款,下列说法正确的是()。有关小区物业管理下列说法正确的是()。
根据《税务行政复议规则》,下列事项中,不可以适用调解的是()。
在1~101中5的倍数的所有数的平均数是()。
信度只受()的影响。
从所给的四个选项中,选择最符合左侧图形规律的一项:
最新回复
(
0
)