trying to make a C++ program to convert a 4 digit octal number to decimal
<p>This here is my code, I have tried googling it but i can find why my code doesnt convert the number properly. however it complies fine. could you please tell me why it is not working and what i should do to fix it. </p>

<pre><code>#include &lt;iostream&gt; 
using namespace std; 

int main() 
{ 
    char a = 0; 
    char b = 0; 
    char c = 0; 
    char d = 0;

    cout &lt;&lt; "Enter 4 digit octal number "; 
    cin &gt;&gt; a &gt;&gt; b &gt;&gt; c &gt;&gt; d; 

    cout &lt;&lt; "Decimal form of that number: " &lt;&lt; (a * 512) + (b * 64) + (c * 8) + d &lt;&lt; endl; 

    return 0; 

}
</code></pre>
