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 pointer to pointer in c with example?

0 Answers  


Differentiate between Macro and ordinary definition.

0 Answers   Motorola,


what is the difference between malloc() and calloc() function?

1 Answers  


struct node {struct node*temp,*new} prinf("%d",sizeof(struct node));

2 Answers  


in one file global variable int i; is declared as static. In another file it is extern int i=100; Is this valid ?

4 Answers   Infosys, NetApp,


What are the 32 keywords in c?

0 Answers  


how to find out the inorder successor of a node in a tree??

2 Answers   TCS, Yahoo,


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

0 Answers  


int main() { int days; printf("enter days you are late"); scanf("%d",days); if (days<=5) printf("5o paisa fine"); if (days<=10&&days>=6) printf("1rs fine"); if(days>10) printf("10 rs fine"); if(days=30) printf("membership cancelled"); return 0; } tell me whats wrong in this program? is it right?

2 Answers  


code for concatination of 2 strings with out using library functions?

3 Answers  


Do you know what are bitwise shift operators in c programming?

0 Answers  


When we use void main and int main?

0 Answers  


Categories