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 / a.balraj

void main()
{
int i,n,p=0,temp,z;
int a[3];
clrscr();
printf("Enter the value of n:\n");
scanf("%d",&n);
i=n;
while(i!=1)
{
if(n%2==0)
{
temp=n%2;
}
else
{
temp=n%2;
}
a[p]=temp;
n=n/2;
i=n+2;
i--;
p++;
}
for(z=sizeof(a)/sizeof(int);z>=0;z--)
{
printf("%d",a[z]);
}
getch();
}

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between far and near in c?

1015


What are the types of type specifiers?

996


Write the Program to reverse a string using pointers.

988


What is a volatile keyword in c?

1132


What is the main difference between calloc () and malloc ()?

1119


Tell me about low level programming languages.

1086


When a c file is executed there are many files that are automatically opened what are they files?

1076


What is omp_num_threads?

1055


What is dynamic dispatch in c++?

1029


What is main return c?

952


Why isnt there a numbered, multi-level break statement to break out

1018


Why doesn't C support function overloading?

2671


Explain enumerated types in c language?

1010


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

2037


What do header files do?

1040