answersLogoWhite

0


Best Answer

int num, bin[50], dec, i=1, j;

printf("Enter the decimal number : ");

scanf("%d",&dec);

num = dec;

while(num!=0)

{

bin[i++] = num%2;

num = num/2;

}

printf("\nBinary equivalent of %d : ",dec);

for(j=i-1;j>0;j--)

{

printf("%d",bin[j]);

}

getch();

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to convert a number into its binary equivalent?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Convert 186 decimal numbers to its binary equivalent?

Convert 189 to binary number


Convert EF16 to a binary number?

The binary equivalent of the hexadecimal number EF16 is 1110111100010110.


Convert whole number 111 to its binary equivalent?

The number 111 in binary would be 1101111


How do you convert decimal number 63 to binary?

The binary equivalent of the decimal number 63 is 111111.


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


Convert binary number 110111 to decimal?

Binary 110111 is equivalent to decimal 55.


What is the answer to Convert the binary number 11000101 to its equivalent decimal number?

11000101 = 197


Convert the decimal numbers 1987 to binary then to octal?

In binary this number is equivalent to 11111000011 while in octal it is 3703


Convert 11101 to decimal?

The decimal equivalent of the binary number 11101 is 29.


Convert 10011001110000000000 into a 6 number decimal?

This Binary Wil Be Equivalent to 629760 in decimal.


Write algorithms and draw a corresponding flow chart to convert a decimal number to binary equiavalent?

Write algorithms and draw a corresponding flow chart to convert a decimal number to binary equivalent?


What is the binary number for 25?

The binary number for 25 is 11001. This is because binary is a base-2 number system, meaning each digit can only be 0 or 1. To convert the decimal number 25 to binary, you divide 25 by 2 repeatedly, noting the remainders from each division. Reading the remainders from bottom to top gives you the binary equivalent.