Monday 27 August 2012

Conversion of decimal to binary using recursion

Conversion of decimal to binary using recursion
#include
void bin(int);
void main()
{
int no;
clrscr();
printf("\nEnter a Decimal Number:");
scanf("%d",&no);
printf("\nBinary Equivalent =");
bin(no);
getch();
}
void bin(int no)
{
int r;
if(no!=0)
{
r=no%2;
no=no/2;
bin(no);
printf("%d",r);
}
}
code for Conversion of decimal to binary using recursion
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: