首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
阅读下面程序,程序执行后的结果为( )。 #include “stdio.h” mam() { char*str=:“abcdefghklmnopq"; while(*str++!=‘e’); printf(“
阅读下面程序,程序执行后的结果为( )。 #include “stdio.h” mam() { char*str=:“abcdefghklmnopq"; while(*str++!=‘e’); printf(“
admin
2021-06-15
23
问题
阅读下面程序,程序执行后的结果为( )。
#include “stdio.h”
mam()
{ char*str=:“abcdefghklmnopq";
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/Cgtp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
已知字符’A’的ASCII代码值是65,字符变量c1的值是’A’,c2的值是’D’。则执行语句printf("%d,%d",c1,c2-2);的输出结果是
以下选项中正确的定义语句是
下列关于switch语句和break语句的结论中,正确的是()。
有以下程序#include<stdio.h>main(){intn,*p=NULL;*p=&n;printf("Inputn:");scanf("%d",&p);printf("outputn:");orintf("%d\n",p:}该
对长度为n的线性表作快速排序,在最坏情况下,比较次数为()。
对软件系统总体结构图,下面描述中错误的是()。
下列选项中,能正确定义数组的语句是
运行下面的程序,输入字符串“MicrosoftVisualStudio",则程序的执行结果是()。#includemain(){charChr[20];scanf("%s",&Chr);pri
设有n个数按从大到小的顺序存放在数组x中,以下能使这n个数在x数组中的顺序变为从小到大的是()。
随机试题
以下关于资源税的应税范围的表述中,正确的有( )。
60钴治疗机等中心误差应不大于
重度脱水与中度脱水的主要区别
关于有机磷中毒叙述错误的是
溃疡病病人如疼痛规律消失,说明可能有
在设备基础测量工作步骤中,基础开挖与基础底层放线的后一步工作是()。
下列选项中不属于产品特征的是()
当每年计息周期数m>1时,实际利率与名义利率的关系是()。
下岗人员共同组成的“自强自立小组”属于小组工作类型中的()。
下列人物,不属于京剧的四大名旦的是()。
最新回复
(
0
)