更多"下列程序的输出结果是 。 #include <stdio.h> voi"的相关试题:
[单项选择]以下程序的输出结果是( )。
#include <stdio.h>
void swap(int*a, int *b)
int*t;
t=a; a=b; b=t;
main( )
int i=3, j=5, *p=&i, *q=&j;
swap(p, q); printf(1%d %d/n, *p, *q);
A. 23
B. 34
C. 35
D. 45
[单项选择]有以下程序:
#include <stdio, h>
void swap1 (int c0[],int e1[] )
int t;
t = c0[0]; c0[0]: c1 [0] ; c1 [0] = t;void swap2(int * c0,int * c1)
int t;
t= *c0; *c0= *c1; * c1 =t;main( )
inta[2]=3.5.b[2]=3,5;
swapl(a,a+1) ;swap2(&b[0],&b[1]);
printf("% d %a %d %d /n" ,a[0] ,a[1] ,b[0] ,b[1] );
程序运行后的车出结果是( )。
A. 3 5 5 3
B. 5 3 3 5
C. 3 5 3 5
D. 5 3 5 3
[单项选择]有以下程序:
#include <stdio.h>
void swap1(int c[])
int t;
t=c[0]; c[0]=c[1]; c[1]=t;
void swap2(int c0,int c1)
int t;
t=c0; c0=c1; c1=t;
main( )
int a[2]=3,5,b[2]=3,5;
swap1(a); swap2(b[0],b[1]);
printf("%d%d%d%d/n",a[0],a[1],b[0],b[1]);
其输出结果是()。
A. 5 3 5 3
B. 5 3 3 5
C. 3 5 3 5
D. 3 5 5 3
[单项选择]以下程序运行后的输出结果是
#include
void fun(int P)
int d=2;
P=d++; printf("%d", P);
main( )
int a=1;
fun(a); printf("%d/n', a);
A. 32
B. 12
C. 21
D. 22
[填空题]
以下程序运行时输出结果是()。
#include
void change(int x,int Y,int *z)
{ int t;
t=x;x=y;y=*z;*z=t;
}
void main( )
{ int x=18,y=27,z=63;
change(x,y,&z);
printf("x=%d,y=%d,z=%d/n",x,y,z);
}
[单项选择]下面程序的运行结果为
#include<iostream.h>
void swap(int &a, int b)
{
int temp;
temp=a++;
a=b;
b=temp;
}
void main( )
int a=2,b=3;
swap(a, b) ;
cout < < a < <"," < < b < < endl;
}
A) 2,3 B) 3,2 C) 2,2 D) 3,3
[填空题]下列程序的输出结果是 【11】 。
#include <stdio.h>
void swap(int *a, int *B)
{
int *t;
t=a;a=b;b=t;
}
main( )
{
int i=3,j=5,*p=&i,*q=&j;
swap(p,q);printf("%d %d/n",*p,*q);
}
[单项选择]下面程序的运行结果为
#include<iostream,h>
Void swap(int &a,int b)
int temp;
temp=a++;
a=b;
b=temp;
void main( )
int a=2,b=3;
swap(a,b);
cout <<a <<”,” <<b <<end1
A. 2,3
B. 3,2
C. 2,2
D. 3,3
[填空题]以下程序运行后输出结果是 【11】 。
#include
void fun(int x)
{ if(x/5>0) fun(x/5);
printf("/%dn",x);
}
main( )
{ fun(11); printf("/n"); }
[简答题]#include<stdio.h>
void swap(int *P,int*q)
int t;
t=*P;*P=*q;*q=t;
main( )
int a=10,b=20;swap(&a,&b );
printf("%d%d/n",a,b );
[简答题]#include<stdio.h>
void swap(int *P,int*q)
{
int t;
t=*P;*P=*q;*q=t;
}
main( )
{int a=10,b=20;swap(&a,&b);
printf("%d%d/n",a,b);
}
[单项选择]下面程序的运行结果为()。
#include<iostream.h>
void swap (int &a, int b)int temp;
temp=a++;
a=b;
b=temp;void main( )int a=2, b=3;
swap(a,b);
cout<<a<<","<<b<<end1;
A. 2,3
B. 3,2
C. 2,2
D. 3,3
[简答题]
#include<stdio.h>
void swap(int x,int y)
{int t;
t=x;x=y;y=t;
printf("%d%d",x,y);
}
main( )
{int a=3,b=4;
swap(a,b);
printf("%d%d/n",a,b);
}
[填空题]以下程序运行后输出结果是 【18】 。
#include <stdio, h>
void swap(int x.int y)
int t;
t = x;x = y;y = t: printf( "% d % d ",x,y);main ( )
iht a=3,b=4:
swap(a,b); prinff( "% d % d" ,a,b);
[填空题]以下程序的输出结果是______。
#include<stdio.h>
void swap(int*a,int*b)
int*t;
t=a;a=b;b=c;
main( )
int i=3,j=5,*p=&i,*q=&j;
swap(p,q);printf("%d %d/n",*p,*q);