title: having issues with simple for loop program. the similar code is having completely different results
body: <p>I am a beginner programmer. i have just started learning c++. I am currently trying to find project which will help me in practicing different types of loop and command statements. in my recent project of creating a program to find factorial for a given number using for loop i am having problems which might be due to code differences. Can you guys help me find the differences in each code and why the outputs of each program are different ?
  this is a code i wrote myself :</p>
  
  <pre><code>    #include &lt;iostream&gt;
  using namespace std;
  int main (){
      int i,B;
  // B=1;
  
      for (i=0; i &lt; 10; i++);
      {
      //B*=i;                
  
      cout &lt;&lt; i;
      //cout &lt;&lt; B &lt;&lt; endl;
  }
  }
  </code></pre>
  
  <p>the code above gives output of only 10</p>
  
  <p>this is a code i copied </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  int main(){
      int a;
      for (int a=1; a &lt;=10;a++)
      {
      cout &lt;&lt; a &lt;&lt; endl ;
      }
  }
  </code></pre>
  
  <p>this gives output of all the numbers upto 10.</p>
  
  <p>i cant see any reason why the first code would give me an output of 10 as it is "&lt;10" and not "&lt;=10</p>