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 an identifier?

1089


What is the use of linkage in c language?

1107


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

1330


What is 2c dna?

1132


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3616


How can you find the exact size of a data type in c?

1051


What does c in a circle mean?

1136


Array is an lvalue or not?

1196


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4757


What is register variable in c language?

1070


How many types of errors are there in c language? Explain

1031


Differentiate call by value and call by reference?

1027


Does c have function or method?

1067


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

2293


What is string function c?

1077