I tried with this code in C# but could not get the desired output and i cudn't find where my mstaking in logic.
You can use method Convert.ToString for that:
string binValue = Convert.ToString(number, 2);
If you nead a leading zeros you can use String PadLeft method:
binValue = binValue.PadLeft(10, '0');