title: How do i set a variable again in a loop
body: <p>I'm new to c++ and have a question with variables</p>
  
  <pre><code>int main() {
      int a;
      int b;
      int c;
      int e;
      int parafechar;
      int loop = 10;
      while(loop==10) {
          cout&lt;&lt; "Coloque a mensal 1\n";
          cin &gt;&gt; a;
          cout&lt;&lt; "Coloque a mensal 2\n";
          cin &gt;&gt; e;
          cout &lt;&lt;"Coloque a nota do cnem\n";
          cin &gt;&gt; b;
          cout &lt;&lt; "Coloque a media dos trabalhos\n";
          cin &gt;&gt; c;
          if(a&gt;b) {
              cout &lt;&lt; "A media e : " &lt;&lt; a*0.5 + b*0.25 + c*0.25&lt;&lt;endl;
          } else {
              cout &lt;&lt; "A media e : " &lt;&lt; e*0.5 + b*0.25 + c*0.25&lt;&lt;endl;
          }
          cout &lt;&lt; "aperte uma tecla para fechar o programa\n";
          cin &gt;&gt; parafechar;
      }
      return 0;
  }
  </code></pre>
  
  <p>after the last line i want the code to run again and all the variables to be set again but the program goes on endless, what should i do ?
  ( the program is in portuguese but it calculate grades)
  thank you for your time and help :)</p>