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,

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is build process in c?

1204


Explain what header files do I need in order to define the standard library functions I use?

1226


Where does the name "C" come from, anyway?

1215


What is the difference between #include

and #include “header file”?

1089


Explain what are the different file extensions involved when programming in c?

1157


Is it possible to initialize a variable at the time it was declared?

1257


Can true be a variable name in c?

1088


Why is python slower than c?

1132


What does %c do in c?

1051


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

1153


What is structure in c explain with example?

1213


Why we use conio h in c?

1301


Explain what is the most efficient way to store flag values?

1271


What is the purpose of 'register' keyword in c language?

1074


What is || operator and how does it function in a program?

1161