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

Stimulate calculator using Switch-case-default statement for two numbers

2925


What is main () in c?

1015


What is string concatenation in c?

1033


How can I do graphics in c?

984


What are the 5 types of organizational structures?

1021


What is a const pointer in c?

1076


What is c basic?

1127


What are structures and unions? State differencves between them.

1103


How many identifiers are there in c?

963


Write a code to generate a series where the next element is the sum of last k terms.

1173


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

3186


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1804


How do you print only part of a string?

968


What are the different types of control structures?

989


How many loops are there in c?

1049