设有下列程序段,则其正确的输出是( )。 int x=011,y=0x11; printf("x=%-3dy=%3d",x,y);
举一反三
- 【9.4】下列程序段的输出结果是。 void fun(int *x, int *y) {printf("%d%d",*x,*y); *x=3; *y=4;} main() {int x=1,y=2; fun(&y, &x); printf("%d%d",x,y); }
- main { int x=3,y=0; y=++x*--x; printf(“y=%d,x=%d\n”,y,x); }输出结果是:
- 有下列程序,程序运行后的输出结果是( )。 #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
- 设有如下定义 int x=10,y=3,z; 则语句 printf("%d\n",z=(x%y,x/y)); 的输出结果是 ( ) A: 3 B: 0 C: 4 D: 1