更多“有以下程序 #include int a=5; void fun(int b) { int a=10; a+=b; printf("%d",a); } void main() { int c=20; …”相关的问题
第1题
有以下程序: #include<stdio.h> int a=5; void fun(int b) { int a=10; a+=b; printf("%d",a); } void main() { int c=20; fun(c); a+=c; printf("%d\n",a); } 请写出程序的运行结果。
点击查看答案
第2题
有以下程序: #include int a=1,b=2: void funl(int a,int b) {printf("%d%d",a,b); } void fun2() { a=3;b=4; } main() { funl(5,6);fun2(); printf("%d%d\n",a,b); } 程序运行后的输出结果是()。
A.1 2 5 6
B.5 6 3 4
C.5 6 1 2
D.3 4 5 6
点击查看答案
第3题
void funB(int a1, int &b1, int* &c1, const int a2, const int &b2, const int *c2) { a1++; //s1 b1++; //s2 *c1 = *c1 + 1; //s3 b2++; //s4 *c2 = *c2 + 1; //s5 a2++; //s6 } 上述代码段中,无法正确编译执行的语句有()
点击查看答案
第4题
有以下程序#include "stdio.h"void fun(int *a,int *b){ int c=20,d=20; *a=c/3; b=d/5;}main(){ int a=3,b=5; fun(&a,&b); printf("%d,%d\n",a,b);}程序的运行结果是A.6,5 B.5,6C.20,25 D.3,5
点击查看答案
第5题
有以下程序:
#include
void fun(int a,int b,int C.
{ a=456,b=567,c=678;}
void main()
{
int X=10,Y=20,Z=30;
fun(X,Y,z);
aout$amp;;$>
}
输出结果是()。
A.30,20,10
B.10,20,30
C.456,567,678
D.678,567,456
点击查看答案
第6题
有以下程序: #include(iostream.h) voidfun(inta,intb,intc) {a=456,b=567,C=678;} voidmain() { intx=10,y=20,z=30; fun(x,Y,z); cout$amp;A.30,20,10
B.10,20,30
C.456,567,678
D.678,567,456
点击查看答案
第7题
以下程序的输出结果是_____________ int a=5; fun(int b) { static int a=10; a+=b++; printf(“%d ”,a); } void main( ) { int c=20; fun(c); a+=c++; printf(“%d\n”,a); }
点击查看答案
第8题
有以下程序: #include<stdio.h> void fun(int a,int b) {int t; t=a;a=b;b=t; } void main( ) {int c[10]={1,2,3,4,5,6,7,8,9,0},i; for(i=0;i<10;i+=2) fun(c[i],c[i+1]); for(i="0;i<10;i++)printf("%d,",c[i]);" printf("\n"); } 程序的运行结果是(> A、0,1,2,3,4,5,6,7,8,9,
B、1,2,3,4,5,6,7,8,9,0,
C、2,1,4,3,6,5,8,7,0,9,
D、0,9,8,7,6,5,4,3,2,1,
点击查看答案
第9题
下列程序的运行结果是()。 #include< iostream.h> void fun (int *a,int*b) {int*k k=a;a=b;b=k} void main() {int a=2004, b=9,*x=&a,*y=&b; fun(x, y) ; cout<<a<<" "<<b<<endl:}
点击查看答案