How Do I convert a number to a binary string?

namespace ToBinary

{

class Program

{

static void Main(string[] args)

{

int val = 51;

string binaryVal = Convert.ToString(val, 2);

Console.WriteLine("The value of {0} is {1}.", val, binaryVal);

Console.ReadLine();

}

}

}

Next Recommended Reading Int32.Parse() vs Convert.ToInt()