title: What is Big O of a loop?
body: <p>I was reading about <strong>Big O notation</strong>. It stated,</p>
  
  <blockquote>
    <p>The big O of a loop is the number of iterations of the loop into
    number of statements within the loop.</p>
  </blockquote>
  
  <p>Here is a code snippet,</p>
  
  <pre><code>for (int i=0 ;i&lt;n; i++)
  {
      cout &lt;&lt;"Hello World"&lt;&lt;endl;
      cout &lt;&lt;"Hello SO";
  }
  </code></pre>
  
  <p>Now according to the definition, the Big O should be <strong>O(n*2)</strong> but it is <strong>O(n)</strong>. Can anyone help me out by explaining why is that?
  Thanks in adavance.</p>