假设int x = 10,y;下列自增自减表达式中正确的是( )。
A: 4--;
B: y = 3++;
C: y = --x;
D: y = ++ ( x / 2 );
A: 4--;
B: y = 3++;
C: y = --x;
D: y = ++ ( x / 2 );
举一反三
- 已知int x=3,y=4;,写出下列表达式的值 (1) (x,y) (2) x>y?x:y (3) x?y:x (4) (x>y)?(y>=2)?1:2:(y>x)?x:y
- 以下程序的输出结果是( )。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
- 如下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, y, z;”且x = 3,y = -4,z = 5,则以下表达式的值为________。 ! (x > y) + (y ! = z) || (x + y) && (y – z)
- 假设 int x=4,y=100,下列语句的循环体共执行了多少次: while(y/x>3) { if(y%x>3) x=x +1; else y=y/x; }