title: Computing Time Complexity in code
body: <p>I had a doubt in computing the time complexity in the following snippet.</p>
  
  <p>Case 1:-
          for (i = n; i>=1 ; <strong>i=i/2</strong>)
          printf("%d", i);</p>
  
  <p>Case 2:-
          for (i = 1; i &lt; n; <strong>i=i*2</strong>)
          printf("%d", i)</p>
  
  <p>Can I tell, the above codes, will take <strong>O(N/2)</strong> or <strong>O(log N)</strong> time complexity to run against the input? </p>
  
  <p>Thanks in advance.</p>