Formating columns in C++
<p>I have the following program that generates a multiplication table. A formating problem arises when the outputs reach the double digits. How do I straighten out the columns?  </p>

<pre><code>#include &lt;iostream&gt;


using namespace std ;
int main() 
{ 

while (1 != 2)
{
    int column, row, c, r, co, ro; 

    cout &lt;&lt; endl ;


    cout &lt;&lt; "Enter the number of columns: " ;
    cin &gt;&gt; column ;
    cout &lt;&lt; endl ;
    cout &lt;&lt; "Enter the number of rows:    " ;
    cin &gt;&gt; row ;
    cout &lt;&lt; endl ;



    int temp[column] ;
    c = 1 ; 
    r = 1 ; 
for(ro = 1; ro &lt; row ; ro ++ ){
    for(co = 1; co &lt; column ; co ++ ){
            c = c ++ ;
            r = r ++ ;
            temp [c]= co * ro;

            cout &lt;&lt; temp[c] &lt;&lt; " ";
}
    cout &lt;&lt; endl ;




}


    system("pause");  

}

}
</code></pre>
