i want to convert Decimal numbers to binary, Currently I'm using this way
private string strtoBin(string input)
{
int number = Convert.ToInt32(input) ;
string res = Convert.ToString(number, 2);
return res;
}
it's working but when I'm having for example "6" I'm getting 110 instead of 0110? Any tips?!