Convert Integer to Binary

serkan sendur 0 Tallied Votes 126 Views Share

Converts Integer to Binary

void bin(int i)
{
	int j=0;
    if(i!=0)
	{
	  j=i;
	  bin(i>>1);
	  printf(" %d ",j&0x01);
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.