代码:
#include <>
#include <>
#include <>
void decToBin(int num)
{
if(num>0)
{
decToBin(num/2);
printf("%d",num%2);
}
}
int main()
{
int num = 1234567891;
decToBin(num);
printf("\n");
return 0;
}
运行结果:
root@ubuntu:/mnt/hgfs/Ubuntu12.04-share# ./test
1001001100101100000001011010011
root@ubuntu:/mnt/hgfs/Ubuntu12.04-share#
参考链接:
/xzongyuan/article/details/28889063