Binary to decimal
<pre><code>int rem, count = 0;
long int n=0, b, i;

count &lt;&lt; "Enter the Binary value to convert in Decimal = ";
cin &gt;&gt; b;
i = b;

while (b &gt; 0)
{
    rem = b % 10;
    n = n + rem * pow(2, count);
    count++;
    b = b / 10;
}

cout &lt;&lt; "The decimal value of Binary no. = " &lt;&lt; i &lt;&lt; " = " &lt;&lt; n;
getch();
</code></pre>

<p>I made this simple program in C++ and now I want to implement it in C# but I couldn't do so because I don't know how to implement the logic which I used in the loop.
Because in C++ the keyword <code>pow</code> is used to multiply the value of <code>2</code> so I don't know how to do it in C#.</p>
