首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include int fun(char s[]){ char*p=s; while(*p!=0) p++; return(p-s);) main(){ printf(
有以下程序 #include int fun(char s[]){ char*p=s; while(*p!=0) p++; return(p-s);) main(){ printf(
admin
2019-08-10
11
问题
有以下程序
#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://jikaoti.com/ti/fof0FFFM
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
数据库设计过程不包括
以下结构体类型说明和变量定义中正确的是( )。
若已建立以下链表结构,指针p、s分别指向如图所示结点则不能将s所指结点插入到链表末尾的语句组是
以下结构体说明和变量定义中,正确的是
结构化程序设计的基本原则不包括( )。
设有以下语句:inta=1,b=2,c;c=a^(b<<2);执行后,c的值为()。
按照C语言规定的用户标识符命名规则,不能出现在标识符中的是()。
下列选项中属于面向对象设计方法主要特征的是
当变量c的值不为2、4、6时,值为"真"的表达式是
请编写函数fun,其功能是求出数组的最大元素在数组中的下标并存放在k所指的存储单元中。例如,输入如下整数:876675896101301401980431451777则输出结果为:6,980注
随机试题
检验报告的封面必须按照要求的字体和字号大小填写承检机构的()全称。
A.痈B.疽C.疔D.疥E.丹毒
汛期来临,漏洞险情发生时,堵塞()是最有效、最常用的方法。
在工程质量检验类型中,科学性、可靠性均较强,且费用较低的是()方法。
下述关于静态投资回收期的说法,正确的有()。
会计凭证的保管期限一般应该为()。
某企业向甲公司销售钢材700吨,单位售价1200元,增值税税率为17%,代垫运杂费7000元,款项未收。销售实现时该企业应记入“应收账款”账户的金额为()元。
包括若干客观性评价指标,以游客满意度为导向的是()评价。
执行下列程序段后,AL=【 】 BUF DW 3436H,1221H,5764H,1111H MOV BX,OFFSET BUF MOV AL,3 XLAT
Idosonotinanattempttocutshortthecareerofyouyoungbanker,butwiththeHopethatyoucouldtakeseveralremedialme
最新回复
(
0
)