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 convert decimal to binary in C using recursion??

Answer Posted / rajaas tahir

# include <stdio.h>
#include<conio.h>
void Bin (int num);

int main (void)
{
int num;
int base;

printf ("Enter the decimal number to convert it binary.\n");
scanf ("%d", &num);

printf ("The %d in binary is : ", num);
Bin (num);
getch();
}

void Bin (int num)
{

int a, b;
a=num/2;
if ((a!= 0) && (num > 1))
{
printf("%d",(num%2));
Bin (num / 2);
}

}

Is This Answer Correct ?    3 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is floating point constants?

1089


Can you return null in c?

1106


What is const volatile variable in c?

996


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

1135


c program for searching a student details among 10 student details

2051


How do I send escape sequences to control a terminal or other device?

1023


write a program in c language to print your bio-data on the screen by using functions.

6744


What is self-referential structure in c programming?

1155


What is the argument of a function in c?

1001


can anyone suggest some site name..where i can get some good data structure puzzles???

2034


What is a loop?

972


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1045


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

3013


Why do we need arrays in c?

1096


Are enumerations really portable?

988