网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
15、执行下列语句段后,输出字符“*”的个数是()。 for (int i=50; i> 1; i-=2) cout <<'*'
A.24
B.25
C.26
D.50
参考答案和解析
B 本题考查for循环语句,--i表示用之前先减1,那么这个for循环语句只有50到2时才会输出“*”,所以总共输出49次。
更多 “15、执行下列语句段后,输出字符“*”的个数是()。 for (int i=50; i> 1; i-=2) cout <<'*'A.24B.25C.26D.50” 相关考题
考题
执行下列语句后,输出的结果为______。void run(){static int x=3;x++;cout<<x<<" ";}int main(){for(int i=0;i<2;i++)fun();return D;}
考题
( 19 )有如下程序段:int i=1;while (1) {i++;if(i == 10) break;if(i%2 == 0) cout '*';}执行这个程序段输出字符 * 的个数是A ) 10B ) 3C ) 4D ) 5
考题
下列程序执行后的输出结果是void funcl(int i);void func2(int i);char st[]="hello,friend!";void fund(int i){ cout<<st[i];if(i<3){i+=2;func2(i);}}void func2(int i){ cout<<st[i];if(i<3){i+=2;funcl(i);}}main( ){int i=0;fund(i);cout<<endl;}A.helloB.helC.hloD.hlm
考题
以下程序执行时,输出“”号的个数是【】。 include vied main(){ int i, j; for(i=1;i
以下程序执行时,输出“”号的个数是【 】。include <iostream.h>vied main(){int i, j;for(i=1;i<5;i++)for(j=2;j<=i;j++)cout<<‘’;}
考题
下列语句段将输出字符'*'的个数为 int i=100; while(1) { i--;; if(i==0) break; cout<<'*'; }A.98个B.99个C.100个D.101个
考题
执行以下程序后,输出号的个数是【】。 include main() {int i, j;for(i=1; i
执行以下程序后,输出号的个数是【 】。include<stdio. h>main(){ int i, j;for(i=1; i<5; i++)for(j=2; j<=i; j++)putchar('');}
考题
有如下程序段:int i=1:while(1){i++;if(i==210) break;if(i%2==0) cout‘*’;}执行这个程序段输出字符*的个数是A.10B.3C.4D.5
考题
执行下列程序后,输出“*”号的个数是______。 include main() { int i,j; for(i=1;i
执行下列程序后,输出“*”号的个数是______。include<iostream.h>main(){int i,j;for(i=1;i<5;i++)for(j=2;j<=i;j++)cout<<'*';}
考题
执行以下程序后,输出“”号的个数是【】。 include main() { int i,j; for(i=1;i
执行以下程序后,输出“”号的个数是【 】。include<iostream.h>main(){int i,j;for(i=1;i<5;i++)for(j=2;j<=i;j++)cout<'';}
考题
有如下程序段: inti=1: while(1){ i++: if(i==10)break: if(i%2==0)cout*: } 执行这个程序段输出字符*的个数是( )。A.10B.3C.4D.5
考题
下列语句段落将输出字符'*'的个数为()。includeVoid main(){int i=100;while(1){i--
下列语句段落将输出字符'*'的个数为( )。#include<iostream.h>Void main(){int i=100;while(1){ i--; if(i==0)break; cout<<'*';}}A.98个B.99个C.100个D.101个
考题
执行下列语句段后,输出字符“*”的个数是( )。 for(int i=50;i1;i-=2)Cout*: A.24S
执行下列语句段后,输出字符“*”的个数是( )。 for(int i=50;i1;i-=2)Cout*:A.24B.25C.26D.50
考题
下列语句段将输出字符'*'的个数为( )。 int i=100; while (1) { i--; if (i==0) break; cout<<'*'; }A.98B.99C.100D.101
考题
下列语句段输出字符'*'的个数为( )。 int i=100; while(1){ i--; if(i==0) break; cout<<'*'; }A.101个B.100个C.99个D.98个
考题
有如下程序段: int i=1; while(1){ i++; if(i==10)break; if(i%2==0)eout<<'$'; } 执行这个程序段输出字符*的个数为A.10B.3C.4D.5
考题
单选题执行下列语句段后,输出字符“*”的个数是( )。for(int i=50;i1;i-=2)cout′*′;A
24B
25C
26D
50
热门标签
最新试卷