Its is inputted by the user...!!!
anyways the program to convert the binary equivalent of a decimal number is as follows:
#include
#include
void main()
{ int i,n,j,b[100];
clrscr();
printf("Enter a Number:");
scanf("%d",&n);
i=0;
while(n>0)
{
b[i]=n%2;
n=n/2;
i++;
}
printf("\n\nBinary Equivalent:");
j=i-1;
for(i=j;j>=0;j--)
printf("%d",b[j]);
getch();
}
using this algorithms... the binary equivalent of any number is taken out...!!! enjoy... have any query... email at :- "devilllcreature@Yahoo.com" thank you....!!!
Chat with our AI personalities
109 base 10
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.
Oh, dude, you're asking about binary now? Alright, so in binary, the decimal number 255 is represented as 11111111. It's like all those ones are just hanging out together, having a binary party. So yeah, 255 in binary is just a bunch of ones chilling together.
1111010011011110 from binary is 62686 in decimal
10010102 = (in base 10) 26 + 23 + 21 = 64 + 8 + 2 = 74