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 / bertilla

#include<conio.h>
#include<stdio.h>
void main()
{
int i,n,arr[15];
for(i=0;i<=14;i++){arr[i]=0;}
do
{
arr[i]=n%2;
n=n/2;
i--;
if(n==1){arr[i]=1;}
}while(n>1);
for(i=0;i<=15;i++)
{
printf("%d",arr[i]);
}
getch();
}

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

1127


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

2645


How do I use void main?

1096


difference between native and cross compilers

2140


How can I prevent another program from modifying part of a file that I am modifying?

1065


What is the difference between text and binary modes?

1199


What are qualifiers and modifiers c?

1014


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

3184


Can you please explain the scope of static variables?

1063


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1731


How to write c functions that modify head pointer of a linked list?

995


What is && in c programming?

1175


Is that possible to store 32768 in an int data type variable?

1093


What is meant by 'bit masking'?

1397


Multiply an Integer Number by 2 Without Using Multiplication Operator

772