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 / naresh m

main()
{
int a[12],n,m,i=0;
printf("enter the no to find binary no's");
scanf("%d",&n);
while(n!=0)
{
m=i++;
a[i]=n%2;
n=n/2;
}
printf("binary value is");
for(i=m;i>=0;i--)
{
printf("%d",a[i]);
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What header files do I need in order to define the standard library functions I use?

1015


How do c compilers work?

1068


What are Macros? What are its advantages and disadvantages?

1106


Is stack a keyword in c?

1046


What does struct node * mean?

982


Is fortran still used in 2018?

998


When should a type cast be used?

977


Can we assign string to char pointer?

1055


For what purpose null pointer used?

1028


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

1000


Is multithreading possible in c?

962


Is file a keyword in c?

896


What is register variable in c language?

998


What is the difference between procedural and functional programming?

1030


What is c variable?

1008