title: Time Complexity of a printf()?
body: <p>I'd like to determine time complexity of a printf such as:</p>
  
  <pre><code>{
      printf("%d",
             i);
  }
  </code></pre>
  
  <p>Or:</p>
  
  <pre><code>{
      printf("%c",
             array[i]);
  }
  </code></pre>
  
  <p>Is it correct to assume that time complexity of a printf is always O(1) or not?</p>
  
  <p>[EDIT] Let's take a function that swaps two values:</p>
  
  <pre><code>void swap(...)
  
  {
  
        tmp = x;
        x = y;    
        y = tmp;  
  
  }
  </code></pre>
  
  <p>Every assignment expression costs 1 (in terms of time complexity), so T(n) = 1 + 1 + 1 = 3 which means O(1). But what can I say about this function?</p>
  
  <pre><code>void swap(...)
  
  {
  
        tmp = x;
        x = y;    
        y = tmp;  
  
        printf("Value of x: %d", x);
        printf("Value of y: %d", y);
  
  }
  </code></pre>
  
  <p>Can I say that T(n) is still O(1) in this case?</p>