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

Should a function contain a return statement if it does not return a value?

1094


Is c easier than java?

1086


What is the stack in c?

1167


Why can arithmetic operations not be performed on void pointers?

1060


What are the different types of linkage exist in c?

1038


What are dangling pointers in c?

1258


What is && in c programming?

1181


differentiate built-in functions and user – defined functions.

1101


How is actual parameter different from the formal parameter?

1030


Does free set pointer to null?

1023


What is %d used for?

1048


How can you invoke another program from within a C program?

1081


Can true be a variable name in c?

1053


Are there constructors in c?

1018


What is data type long in c?

1082