执行以下程序后,输出结果为 #include[stdio.h] void main() { int x; float y; y=3.6; x=(int)y+10; cout<<"x="<A: x=13,y=3.600000
B: x=13.5,y=3.60000
C: x=13,y=3
D: x=13,y=3.6
B: x=13.5,y=3.60000
C: x=13,y=3
D: x=13,y=3.6
举一反三
- 如下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) {cout < < * X < < 下列程序段的输出结果是 #include<iostream.h> void fun(int * X,int * y) { cout < < * X < < * y; * X=3; * y=4; } void main( ) { int x=1,y=2; fun(&y,&x); cout < < X < < y < < end1; } A.2143 B.1212 C.1234 D.2112
- 下面程序运行后的输出结果是_________。#include [stdio.h]int main(){ int x=10,y=20,t=0; if(x==y) t=x;x=y;y=t; printf("%d",x);}
- 以下程序的输出结果是( )。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; }