下列程序的输出结果是【1】。 int t(int x,int y,int cp,int dp) { cp=x*x+y*y; dp=x*x-y*y; } void main( ) { int a=4,b=3,c=5,d=6; t(a,b,c,d); printf("%d %d \n",c,d); }
举一反三
- 下面程序的执行结果是______ #include int t(int x,int y,int cp,int dp){ cp=x*x+y*y;dp=x*x-y*y;} int main( ){ int a=4,b=3,c=5,d=6;t(a,b,c,d);printf("c=%d,d=%d",c,d);return 0;}
- 以下程序的输出结果是( )。main(){ int x=1,y=2; void swap(int x,int y); swap(x,y); printf("x=%d,y=%d\n",x,y);}void swap(int x,int y){ x=3,y=4;} A: x=3,y=4 B: x=1,y=2 C: x=3 y=4 D: x=1 y=2
- 有下列程序,程序运行后的输出结果是( )。 #include void fun( int *x,int *y); int main() { int x=1,y=2; fun(&y,&x); printf("%d %d",x,y); return 0; } void fun( int *x,int *y) { printf("%d%d",*x,*y); *x=3;*y=4; }
- 如下C程序的输出是什么?#include [stdio.h]void Func1 (int x, int y);void Func2 (int *x, int *y); int main() { int x = 3; int y = 4;Func1 (x, y); printf ("x = %d, y = %d\n", x, y);Func2(&x, &y); printf ("x = %d, y = %d\n", x, y);} void Func1 (int x, int y) { x = x + y; y = x - y; x = x - y; printf ("x = %d, y = %d\n", x, y);} void Func2 (int *x, int *y) { *x = *x + *y; *y = *x - *y; *x = *x - *y;;} A: x = 3, y = 4x = 3, y = 4x = 3, y = 4 B: x = 4, y = 3x = 4, y = 3x = 4, y = 3 C: x = 3, y = 4x = 3, y = 4x = 4, y = 3 D: x = 4, y = 3x = 3, y = 4x = 4, y = 3
- 以下程序的输出结果是( )。 #include void fun(int x,int y,int *cp,int *dp) { cp=x+y; //*cp=30+50=80 dp=x-y; //*dp=30-50=-20 } void main() { int a,b,c,d; a=30,b=50; fun(a,b,&c,&d); cout< 80,-20