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 is the defrenece between structure and union

5 Answers   Aloha Technology,


Is c is a procedural language?

0 Answers  


in linking some of os executables are linking name some of them

0 Answers   IBM,


What is variable and explain rules to declare variable in c?

0 Answers  


How to reverse a string using a recursive function, with swapping?

5 Answers  


Is double link list a linear data structure? If Yes, Why?If No, Why?

4 Answers  


What is the function of volatile in c language?

0 Answers  


write a c program to store and print name,address,roll.no of a student using structures?

7 Answers  


all c language question

0 Answers   Wipro,


Can you write the function prototype, definition and mention the other requirements.

0 Answers   Adobe,


What is a nested formula?

0 Answers  


pgm to find middle element of linklist(in efficent manner)

4 Answers   Huawei,


Categories