更多"下面程序的运行结果是 ______。 #include<iostre"的相关试题:
[填空题]下面程序的运行结果是______。
#include <iostream.h>
void main( )
char s[]="9876", *p;
for(p=s;p<s+2;p++)
cout<<p;
[单项选择]以下程序运行后的输出结果是( )。
#include<iostream.h>
void main( )
char aft="abbcabbcabbc";
int i=0,j=0,k=0;
while(a[i])
if(a[i]==’a’)
j++;
if(a[i]==’b’)
k++;
i++;
cout<<j<<""<<k<<end1;
A. 2,6
B. 3,5
C. 4,7
D. 3,6
[填空题]下面程序的执行结果是 [7] 。
#include<iostream.h>
void main( ){
int a=0,b=2,c=0,d=30;
if(a)
d=d-10;
else if(B)
if(!C)
d=15;
else d=20;
cout<< “d=” <<d<<end1;
[填空题]下面程序的执行结果是 【15】 。
#include <iostream.h>
void main( )
int n=0,x=0;
do
n++;
if(n%3==2&&n%5==3&&n%7==2)
x=1;
while(x!=1);
cout<<"n="<<n<<end1;
[填空题]下面程序的输出结果是 【9】 。
#include<iostream.h>
void main( )
{
int a[6]={1,2,3,4,5,6};
for(int i=0;i<5;i++)
cout <<a[i] <<" ";
cout <<end1;
}
[填空题]下面程序的运行结果为
【13】 。
#include <iostream.h>
void main( )
unsigned char value=127;
int total=100;
value++;
total+=value;
cout<<total<<end1;
[填空题]下面程序的执行结果是______。
#include <iostream.h>
void main( )
int n=0,x=0;
do
n++;
if(n%3==2&&n%5==3&&n%7==2)
x=1;
while(x!=1);
cout<<"n="<<n<<endl;
[填空题]下面程序的运行结果为______。
#include <iostream.h>
void main( )
char a=’3’;
switch(a)
case’3’: cout<<"3";
case’2’: cout<<"2"; break;
default: cout<<"1";
[单项选择]下面程序的运行结果是
#include<iostream.h>
Void main( )
int num=1;
int &ref=num;
ref=ref+2;
cout < < num;
num=num+3;
cout < < ref < <endl;
A) 13 B) 16 C) 36 D) 33
[单项选择]下面程序的运行结果是
#include<iostream.h>
void main( )
int i=1;
while(i<=8)
if(++i%3!=2)continue;
else cout < < i;
A. 25
B. 36
C. 258
D. 369
[单项选择]下列程序的运行结果是
#include
void fun(int *a, int *b)
{ int *k;
k=a; a=b; b=k;
}
void main( )
{ int a=3, b=6, *x=&a, *y=&b;
fun(x,y);
cout<<a<<" "<<b;
}
A. 6 3
B. 3 6
C. 编译出错
D. 0 0
[单项选择]下面程序的运行结果是
# include <iostream.h>
void fun(int * a,int * b)
int x= * a;
* a= * b; * b=X;
cout << * a << * b<<" " ;
void main( )
int x=1, y=2;
fun (& x,& y);
cout < < X << y << endl;
A. 12 12
B. 12 21
C. 21 12
D. 21 21