单选题
C++
题号 #4238491
执行下列语句段后,输出字符“*”的个数是( )。
for(int i=50;i>1;i-=2)
cout<<’}’:
参考答案
B
答案解析
本题考查for循环语句,题目中每执行完循环体后,i都会减2,那么只有50到2之间的偶数才能输出“*”,所以总共输出25次。
你可能感兴趣的试题
A.const int a;
B.const int a=10;
C.const int*point=0;
D.const int*point=new int(10):
A.FA必须定义在FB之前
B.FB必须定义在FA之前
C.若FA定义在FB之后,则FA的原型必须出现在FB的定义之前
D.若FB定义在FA之后,则FB的原型必须出现在FA的定义之前