首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读下面程序,程序执行后的结果为( )。 #include"stdio.h" main() {char*str="abcdefghijklmnopq"; while(*str++!=’e’); printf("%c\n".*str); }
阅读下面程序,程序执行后的结果为( )。 #include"stdio.h" main() {char*str="abcdefghijklmnopq"; while(*str++!=’e’); printf("%c\n".*str); }
admin
2020-06-16
28
问题
阅读下面程序,程序执行后的结果为( )。
#include"stdio.h"
main()
{char*str="abcdefghijklmnopq";
while(*str++!=’e’);
printf("%c\n".*str);
}
选项
A、f
B、a
C、e
D、q
答案
A
解析
本题考查的是取内容运算符“*”和自加运算符“++”的优先级问题。由于“++”的优先级高于“*”, 所以题干中“*str++!=’e’”,即“*(str++)!=’e’”,当str指向字符“’e’”时,while循环的条件不成立,但“str”已经进行了自加指向了字符“’f’”,所以“*str”输出字符“’f’”。
转载请注明原文地址:https://kaotiyun.com/show/3s3p777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
下列给定程序中,函数fun的功能是:把形参a所指数组中的偶数按原顺序依次存放到a[0]、a[1]、a[2]…中,把奇数从数组中删除,偶数的个数通过函数值返回。例如,若a所指数组中的数据最初排列为:9、1、4、2、3、6,5、8、7,删除奇数后,a
有以下程序:#include<stdio.h>main(){FILE*pf;char*s1="China,",*s2="Beijing";pf=fopen("abc.dat","wb+");fwrite(s2,7,1,pf);rewind
有以下程序:#include<stdio.h>main(){intx=1,y=2,z=3;if(x>y)if(y<z)printf("%d",++z);elseprintf("%d",++y);printf("%d\n",x++);}
有以下程序:#include<stdio.h>main(){inta=1,b=2,c=3,d=0;if(a==1&&b++==2)if(b!=2||c--!=3)prinff("%d,%d,%d\n",a,b,c);elseprinf
在一个C源程序文件中所定义的全局变量,其作用域为()。
使用VC++2010打开考生文件夹下prog1中的解决方案。此解决方案的项目中包含一个源程序文件prog1.c。在此程序中,编写函数fun,其功能是:判断t所指字符串中的字母是否由连续递增字母序列组成(字符串长度大于等于2)。例如字符串:uvwxyz满足要
使用VC++2010打开考生文件夹下prog1中的解决方案。此解决方案的项目中包含一个源程序文件prog1.c。在此程序中,规定输入的字符串中只包含字母和*号。请编写函数fun,其功能是:将字符串尾部的*号全部删除,前面和中间的*号不动。例如,字符串中的
以下选项中正确的语句组是()。
使用VC++2010打开考生文件夹下modi1中的解决方案。此解决方案的项目中包含一个源程序文件modi1.c。此程序的功能是:建立一个带头结点的单向链表,并用随机函数为各结点数据域赋值。函数fun的作用是求出单向链表结点(不包括头结点)数据域中的最大值,
数据字典(DD)所定义的对象都包含于
随机试题
A.金属离子络合剂B.抗氧剂C.pH调节剂D.主药E.注射用溶剂在维生素C注射液处方中:碳酸氢钠是()。
关于心电触发脉冲方式的说法,不正确的是
下列说法正确的是()。
钢材的重要指标(),是钢材弹性变形转变为塑性变形的转折点。
无风险利率对期权的时间价值的影响有()。Ⅰ.当利率提高时,期权的时间价值会减少Ⅱ.当利率提高时,期权的时间价值会增高Ⅲ.当利率下降时,期权的时间价值会增高Ⅳ.当利率下降时,期权的时间价值会减少
我国的凭证式国债通过()面向社会发行。
“视其所以,观其所由,察其所安。”这句话反映了教学的()。
软件工程学一般包括软件开发技术和软件工程制造的方面内容.软件工程经济学是软件工程管理的技术内容之一,它专门研究()。
(l)Hippiesweremembersofayouthmovementofthe1960’sand1970’sthatstartedintheUnitedStatesandspreadtoCanada,Gre
在我国,某客户6月5日美元持仓。6月6日该客户通过期货公司买入10手棉花期货合约,成交价为10250元/吨,当日棉花期货未平仓。当日结算价为10210元/吨,期货公司要求的交易保证金比例为5%,该客户的当日盈亏为()元。
最新回复
(
0
)