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

Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

0 Answers  


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

0 Answers   RBI,


write a pgm to print 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1

3 Answers  


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

0 Answers  


What is a pragma?

0 Answers  


What is the maximum length of an identifier?

0 Answers  


How can I insert or delete a line (or record) in the middle of a file?

0 Answers  


Is it fine to write void main () or main () in c?

0 Answers  


print the table 5 in loops

3 Answers  


What are the 4 types of functions?

0 Answers  


What is the difference between break and continue?

3 Answers  


What's the total generic pointer type?

0 Answers  


Categories