1
30
1-2
死循环
第1题:
有如下程序段:
char C[20]="examination";
C[4]=0;
cout<<c<<endl;
这个程序的输出结果是______。
第2题:
有如下程序段:
intx=1,y=2,z=3;
x=x^z:
y=y^z;
z=x^y:
cout<<x<<y<<z;
这个程序段的输出结果是______。
第3题:
有如下程序: <br>int x=3;<br>do{<br>x -= 2;<br>cout<<br>}while(!(--x));<br> 执行这个程序的输出结果是 <br>
A . 1 <br>
B . 3 0 <br>
C . l-2 <br>
D .死循环 <br>
第4题:
有如下程序: int x=3; do { x-=2; cout<<x; } while(!(--x)); 执行这个程序的输出结果是( )。
A.1
B.30
C.1-2
D.死循环
第5题:
执行如下程序后的输出结果是【 】。
include <iostream>
include <fstream>
using namespace std;
int main ( )
{
char s[25];
ofstream fl("data.txt");
f1<<"C++ Programming";
f1.close ();
ifstream f2 ("data.txt");
第6题:
( 8 )有如下程序段:
Char c [20]="examination" ;
c[4]=0;
cout<<c<<endl;
执行这个程序段的输出是【 8 】 。
第7题:
有如下程序段:
for(inti=i;i<=50;i++){
if(i%3 1=0)continue;
else if(i%5 1=0)continue;
cout<<i<<",";
这个程序的输出结果是______。
第8题:
有如下程序:
#include
#include
using namespace std;
int main()
{
cout.fill('*');
cout<
return 0;
}
执行这个程序的输出结果是
A . 123*OK
B . 123*OK**
C . *123OK
D . *123**OK
第9题:
有如下程序:#include <iostream>#include <iomanip>using namespace std;int main(){cout.fill('*');cout<<left<<setw(4)<<123<< "OK"<<end1;return 0;}执行这个程序的输出结果是( )。
A.123*OK
B.123*OK**
C.*123OK
D.*123**OK
第10题:
有如下程序: #inClude<iostream> using namespaCe std: Class CD{ publiC: ~CD{Cout<<’C’:} private: Char name[80]; }; int main{ CD a,*b,d[2]; return 0; 执行这个程序的输出结果是( )。
A.CCCC
B.CCC
C.CC
D.C