title: '\0' and printf() in C
body: <p>In an introductory course of C, I have learned that while storing the strings are stored with null character <code>\0</code> at the end of it. But what if I wanted to print a string, say <code>printf("hello")</code> although I've found that that it doesn't end with <code>\0</code> by following statement</p>
  
  <pre><code>printf("%d", printf("hello"));
  
  Output: 5
  </code></pre>
  
  <p>but this seem to be inconsistent, as far I know that variable like strings get stored in main memory and I guess while printing something it might also be stored in main memory, then why the difference?</p>