首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include int fun(char s[]){ char*P=s: while(*P!=0) p++; return(p-s);} main(){ printf("%d\n",f
有以下程序 #include int fun(char s[]){ char*P=s: while(*P!=0) p++; return(p-s);} main(){ printf("%d\n",f
admin
2015-08-14
19
问题
有以下程序
#include
int fun(char s[]){
char*P=s:
while(*P!=0) p++;
return(p-s);}
main(){
printf("%d\n",fun("0ABCDEF"));}
程序运行后的输出结果是
选项
A、6
B、7
C、1
D、0
答案
B
解析
函数fun的主要功能是计算字符串中实际字符的个数,因此主函数中调用fun得到结果为7。
转载请注明原文地址:https://kaotiyun.com/show/yGDp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
软件是程序、数据和______的集合。
以下选项中,非法的字符常量是______。
以理程序的输出结果______。main(){charst[20]="he11\O\t\\";printf("%d%d\n",str1en(st),sizeof(st));}
以下程序的输出结果是______。main(){inta[4][4]={{1,3,5},{2,4,6},{3,5,7}}printf("%d%d%d%d\n",a[0][3],a[1][2]
若有说明inti,j=2,*p=&i;,则能完成i=j赋值功能的语句是______。
以下程序的输出结果是______。charcchar(charch){if(ch>=’A’&&ch<=’z’)ch=ch-’A’+’a’;returnch;}main(){chars[]
下列的程序用来输出两个字符串前7个字符中对应相等的字符及其位置号,程序空白处应该填写的是()。#include<stdio.h>main(){chars1[]="chinese",s2[]="japnese";
下列选项中,不是一个算法的基本特征的是()。
已知函数fread的调用形式为fread(buffet,size,count,fp);,其中buffer代表的是()。
以下选项中,不能作为合法常量的是
随机试题
男性20岁,右眼睑红肿、流泪2天,伴大量黄色脓性分泌物,结膜充血水肿明显,角膜透明、前房正常,应进一步检查
患者男,68岁。因右上尖牙残根要求拔除。患者既往患有高血压史10年,糖尿病5年。今测BP120/80mmHg,空腹血糖8.0mmol/L。应为患者选用何种麻醉药物
【背景资料】某公司拟投标某市政工程,该工程技术要求较高,而该公司在这类工程的施工中有丰富的业绩和较高声誉。招标单位提供的招标文件提供了工程量清单。在购买标书后,对报价部分采用了如下计算法,工程量直接使用清单数量,价格使用某定额站的信息价格。由于措施项目
在下列情形中,代理人应当向被代理人承担民事责任的有()。
室内消火栓手轮轮缘上应明显地铸出标示开关方向的箭头和字样,手轮直径应符合要求,如常用的SN65型手轮直径不应小于()mm。
证券价格反映了全部公开的信息,但不反映内幕信息,这样的市场称为()。
()的问世,标志着我国古代建筑技术已经发展到较高的阶段,它是我国和世界建筑史上的珍贵资料。
(2013年真题)根据我国合同法规定,以书面形式作出承诺的,承诺的生效时间是()。
假定在工程文件中有一个标准模块,其中定义了如下记录类型TypeBooksNameAsString*10TelNumAsString*20EndType要求在
硬盘属于
最新回复
(
0
)