Decimal to Binary and vice versa

Mar 26 2011 10:43 PM
Good day,
 
I want to convert decimal to binary number using c# asp.net. I know there is a certain 'CONVERT' method i could to achieve this, but is that i want the result with details.

For example: decimal to binary (10 to base2)
10 / 2 = 5 R 0
5 / 2 = 2 R 1
2 / 2 = 1 R 0
1 / 2 = 0 R 1

So the corresponding result to 10 = 1010 in base 2. So therefore, if a user type in 10 he gets 1010 and how the result was came about. please help ... :) .. Thanks in advance.

Answers (11)