title: Big O notation explanation nested while loop
body: <p>I was wondering what the big o notation is for the following (java)code:</p>
  
  <pre><code>while (n &gt; 0) {
       while (n &gt; 0){
          n-- ;
      }
   } 
  </code></pre>
  
  <p>If I use <strong>n = 10</strong> it will do one iteration in the outer loop and 10 inside the inner loop. <br> So a total of <strong>11 iterations</strong> right? <br>
  if I use <strong>n = 100</strong> it will de one iteration in the outer loop and 100 inside the inner loop. <br> So a total of <strong>101 iterations</strong> right? <br>
  But this is the point where I got stuck. Because I think the notation is O(n). Simply because I think the iteration are almost equal to n.
  But I don't know how to prove it?
  <br></p>
  
  <p><em>I am not that much in math so a clear explanation would be appriciated</em></p>