#include <stdio.h>
void
main()
{
int
iNumOf1 = 0,i = 1;
long
int
lDec,lBin = 0;
printf
(
"Please input the decimal nummber:\n"
);
scanf
(
"%ld"
,&lDec);
do
{
if
(0 != lDec%2)
{
iNumOf1++;
}
lBin += lDec%2*i;
i *= 10;
lDec /= 2;
}
while
(lDec);
printf
(
"Binary & nummbers of 1:\n%d %d\n"
, lBin,iNumOf1);
}