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 find the binary of a number?

Answer Posted / kk

let the number be n
int bin(int n)
{
static int sum=0;

if(n>1)
{
rem=n%2;
sum = sum *10 +rem;
n=n/2;
bin(n);
}
else
{
sum=sum*10+1;
}
return sum;
}

Is This Answer Correct ?    7 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null always defined as 0(zero)?

1098


How can I list all of the predefined identifiers?

982


What are logical errors and how does it differ from syntax errors?

1292


What is static and volatile in c?

1217


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

1325


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1266


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2635


Why c is called free form language?

1019


Why do we use namespace feature?

1051


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1118


What is double pointer in c?

1036


What is the purpose of sprintf?

1128


What is the difference between formatted&unformatted i/o functions?

1049


What is page thrashing?

1080


What’s the special use of UNIONS?

1150