Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to write a prog in c to convert decimal number into
binary by using recursen function,



how to write a prog in c to convert decimal number into binary by using recursen function,..

Answer / madhavi

void decitobin(int n);

main()
{
int n;
printf("Enter an integer:");
scanf("%d",&n);
decitobin(n);
}

void decitobin(int n)
{
if(n>0)
{
decitobin(n/2);
printf("%d",n%2);
}
}

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

What are linker error?

0 Answers  


Explain what does the function toupper() do?

0 Answers  


what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason

3 Answers  


What is the difference between near, far and huge pointers?

0 Answers  


What is advantage of pointer in c?

0 Answers  


What is character set?

0 Answers  


Write code for atoi(x) where x is hexadecimal string.

5 Answers   Adobe,


what are the advantages of a macro over a function?

0 Answers   TCS,


Write a function to find the area of a triangle whose length of three sides is given

2 Answers  


write a c program to add two integer numbers without using arithmetic operator +

13 Answers   Value Labs,


What is a memory leak? How to avoid it?

1 Answers  


Can we initialize extern variable in c?

0 Answers  


Categories