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

Which is best linux os?

1024


What are comments and how do you insert it in a C program?

1245


What is pass by reference in c?

1186


Explain what does a function declared as pascal do differently?

1278


What is a method in c?

1135


Explain About fork()?

1113


What are the different types of control structures in programming?

1126


Why does notstrcat(string, "!");Work?

1133


How do you define a string?

1101


What is getch c?

1294


console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above

1170


What are # preprocessor operator in c?

1105


What is the difference between a function and a method in c?

1079


What are the key features in c programming language?

1070


Can we change the value of constant variable in c?

1053