下列程序的执行结果为______。
include<iostream.h>
void main()
{
cout.fill(‘*’);
tout.width(10);
cout<<“hello”<<endl;
)
第1题:
下列程序的运行结果为
#include<iostream.h>
void main( )
{
int a=2;
int b=a+1;
cout < < a/b < < endl;
}
A.0.66667
B.0
C.0.7
D.0.66666666…
第2题:
以下程序的输出结果是【 】。
include<iostream.h>
void main( )
}
int a=0;
a+=(a=8) ;
cout<<a;
}
第3题:
下面程序的输出结果为______
include<iostream.h>
void main()
{
cout<<"Hello\b";
}
第4题:
执行下列程序的结果是( )。 #include<iostream.h> void main() { char *str; str="test!"; cout<<str[5]; }
A.test!
B.test
C.空字符
D.异常
第5题:
下面程序的执行结果是______。
include<iostream.h>
include<iomanip.h>
using namespace std;
void main()
{
cout<<setfill('x')<<setw(10);
cout<<"Hello"<<endl;
}
第6题:
程序
include" iostream.h"
void main( )
{
int i=10;
jnt j=5;
cout < < j+i++ < < end1;
}
的结果为【 】
第7题:
下列程序的运行结果为______。
include<iostream.h>
void main( )
{
int i;
for(i=1;i<6;i++)if(i==3)break;
cout<<"i="<<i<<endl;
}
第8题:
下列程序的执行结果为【15】。
#include(iostream. h>
void main()
{
Cout.fill(’*’);
cout. width(10);
cout <<”hello”<
}
第9题:
下列程序的运行结果为【 】。
include<iostream.h>
void main(void)
{int a=2,b=-1,c=2;
if(a<b)
if(b<0)c=0;
else c=c+1;
cout<<c<<endl;
}
第10题:
以下程序的执行结果是【 】。
include<iostream.h>
include<iomanip.h>
void pnnt(int n)
{
if (n!=0)
{
Print(n-1);
for (int i=1;i<=n;i++)
cout<<setw(3)<<i;
cout<<endl;
}
}
void main()
{
print(4);
}