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

How can you check to see whether a symbol is defined?

1106


Why is C language being considered a middle level language?

1137


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1080


What is the advantage of a random access file?

1208


What is "Duff's Device"?

1175


Do you know the difference between malloc() and calloc() function?

1073


What is a scope resolution operator in c?

1287


Which is the best website to learn c programming?

1087


How do you convert strings to numbers in C?

1235


What is #error and use of it?

1287


What is hash table in c?

1030


how to find binary of number?

4462


What are register variables in c?

1020


swap 2 numbers without using third variable?

1141


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1399