![](https://csdnimg.cn/release/download_crawler_static/87688879/bg6.jpg)
*z=x+y;
}
10.函数 func 的功能是将整型变量 x 的值转换成二进制数,并将该二进制数的每一
位存入由整型指针 b 所指向的一维数组 a,最低位存放于 a[0]中,次低位存放于 a[1]
中,依此类推。请填空。
void func(int x,int *b)
{
int r;
do
{
r=x%2;
_____________=r;
x/=2;
} while (x);
}
11.以下程序中函数 invert 实现将数组内所有数组元素的值逆置。比如,执行本程
序将输出:
10 9 8 7 6 5 4 3 2 1
请填空。
#include <stdio.h>
main()
{
int a[10]={1,2,3,4,5,6,7,8,9,10},i,n=10;
invert(a,n-1);
for (i=0;i<10;i++)
printf("%3d",a[i]);
printf("\n");
}