How can I clear the variable after while loop is done : <p>I'm writing a program that multiplies matrices. And here I have got two variables "i" and "q" which at the beginning are both 0. While the loops proceed variables ("i" and "q") change their values. However after the loops are done I need "i" and "q" to come back to the value 0, so the loops can repeat themselves for different "w" and "k" . How can I do so??</p>

<pre class="lang-cpp prettyprint-override"><code>
 int wynik[x][z]; //table that holds the result of the multiplication
 int i=0;
 int q=0;
 int wyn=0;
 for(int w=0; w&lt;x; w++)
 {
     for(int k=0; k&lt;z; k++)
     {
         while((i&lt;y) &amp;&amp; (q&lt;v) )
         {
            wyn = (tab1[w][i] * tab2[q][k]) + wyn;
            i++;
            q++;

         }
        wynik[w][k] = wyn;
     }
  }
</code></pre>
