首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
以下程序的输出结果是( )。 #include<iostream.h> main() { int m=5: if(m++>5) cout<<m; else cout<<m--; }
以下程序的输出结果是( )。 #include<iostream.h> main() { int m=5: if(m++>5) cout<<m; else cout<<m--; }
admin
2016-10-28
34
问题
以下程序的输出结果是( )。
#include<iostream.h>
main()
{
int m=5:
if(m++>5)
cout<<m;
else cout<<m--;
}
选项
A、7
B、6
C、5
D、4
答案
B
解析
此题中,因为m++>5成立(此时m的值变为6),所以执行语句cout<<m;输出结果为6。
转载请注明原文地址:https://kaotiyun.com/show/iONp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列程序的输出结果是#include<iostream.h>voidmain(){char*str="12123434";intx1=0,x2=0,x3=0,x4=0,i;for(i=0;str[
有如下程序#include<iostream.h>voidmain(){floatX=2.0,y;if(x<0.0)y=0.0;elseif(x<10.0)y=1.0/x;
若已定义的函数有返回值,则以下关于该函数调用的叙述中错误的是
有如下的程序:#include<iostream>usingnamespacestd;classAT{friendostream&operator<<(ostream&,AT);}at;os
类模板不同于函数模板,类模板只可用【】型参数。
Jackson结构化程序设计方法是英国的M.Jackson提出的,它是一种面向【】的设计方法。
有如下程序#include<iostream.h>voidmain(){charch[2][5]={"6937","8254"},*p[2];inti,j,s=0;for(i=0;i<2;i++)p[
有如下函数模板定义:template<typenameT1,typenameT2,typenameT3>T2plusT1t1,T3t3){returnt1+t3;}则以下调用中正确是
通过使用new和delete两个运算符进行的分配为【】存储分配。
假定int类型变量占用两个字节,其有定义intx[10]={0,2,4};,则数组x在内存中所占字节数是
随机试题
SET协议使用的安全技术不包括
ScientistssaythatplantandanimallifeinthousandsoflakesintheUnitedStatesandCanadahasalreadybeendestroyedbyac
发生传染病暴发流行时,医疗卫生机构应做到
A.贝氏隐孢子虫B.火鸡隐孢子虫C.鼠隐孢子虫D.微小隐孢子虫E.安氏隐孢子虫寄生于禽类法氏囊、泄殖腔等器官的隐孢子虫是()
对于国外厂家燃用重油的燃烧器来说,一般是按()重油设计的。
下列选项中属于工程分析的作用是( )。
以下说法正确的有()。
•Youwillhearfiveshortrecordings.•Foreachrecording,decidewhatadvicethespeakerisgiving.•Writeoneletter(A-H)nex
What’sabetterteachingmethod?JimMunch’sexperienceLASTspring,whenhewasonlyasophomore,JimMunchreceivedaplaq
HowShouldTeachersBeRewarded?[A]Weneverforgetourbestteachers—thosewhoinspireduswithadeeperunderstandingor
最新回复
(
0
)