以下( )表达式不能够表示X是Y的倍数.
A: X/Y=X\Y
B: X Mod Y=0
C: X\Y=INT(X/Y)
D: X/Y=INT(X/Y)
A: X/Y=X\Y
B: X Mod Y=0
C: X\Y=INT(X/Y)
D: X/Y=INT(X/Y)
举一反三
- 如下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
- 定义一个函数实现交换x和y的值,并将结果正确返回。能够实现此功能的是() A: swapa(int x,int y){ int temp;temp=x;x=y;y=temp;} B: swapb(int *x,int *y){ int temp;temp=x;x=y;y=temp;} C: swapc(int *x,int *y){ int temp;temp=*x;*x=*y;*y=temp;} D: swapd(int *x,int *y){ int *temp;temp=x;x=y;y=temp;}
- 能够实现两数交换功能的函数是() A: void Swap(int x,int y){int pTemp;pTemp=x;x=y;y=pTemp;} B: void Swap(int *x,int *y){int *pTemp;*pTemp=*x; *x=*y; *y=*pTemp;} C: void Swap(int *x,int *y){int *pTemp;pTemp=x; x=y; y=pTemp} D: void Swap(int *x,int *y) {int pTemp;pTemp=*x; *x=*y; *y=pTemp}
- 要求函数的功能是交换x和y中的值,且通过正确调用返回交换结果。能正确表示此功能的函数是( )。 A: void funa(int *x, int *y) { int *p; *p = *x; *x = *y, *y = *p; } B: void funb(int x, int y) { int t; t = x; x = y; y = t; } C: void func(int *x, int *y) { *x = *y; *y = *x; } D: { *x = *x + *y; *y = *x - *y; *x = *x - *y; }
- int x=2, y=5; 则x + y =_____x - y =_____x * y =_____x / y =_____x % y =_____