Click here to Skip to main content
15,796,738 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to convert binary value to decimal value.
Suppose i want to convert 111 can any one give me code for this.

Conversion of Decimal to any Base (Binary, Octal or Hexa) and vice-versa (C#)[^]

However, honestly speaking, this appears to be homework and you should give it a try before asking questions here.
Share this answer
jaideepsinh 10-Dec-11 2:48am    
No Dear,But i have some easy code for convert hexadecimal to binary like this
TreeBinaryval = Convert.ToString(Convert.ToInt32(TreeStartOfMessage, 16), 2);
so i want if i get some easy code like this for convert binary to decimal so i ask.
Rubaba 10-Dec-11 10:44am    
my 5
Abhinav S 10-Dec-11 10:44am    
Thank you.
try this link :[^]

Leads to a page of my suggestion for this problem,
and you can also see many other solutions,
even better, refers to the program code.
Share this answer
This is an article I posted a long time ago that may help: Binary, octal, and hexadecimal 32 bit structs[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900