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

Why n++ execute faster than n+1 ?

3019


Explain how are 16- and 32-bit numbers stored?

1271


Why do we use pointer to pointer in c?

1086


which is an algorithm for sorting in a growing Lexicographic order

1808


What is define c?

1080


What is 2c dna?

1081


Explain what is wrong in this statement?

1125


ATM machine and railway reservation class/object diagram

5253


The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

3584


What is modeling?

1054


What is the difference between procedural and functional programming?

1081


Explain how can type-insensitive macros be created?

999


What language is windows 1.0 written?

1068


Can you think of a logic behind the game minesweeper.

2468


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

1123