title: Difference between puts() and printf() in C while using sleep()
body: <p>I was wondering the difference between puts() and printf() functions while using sleep() function.</p>
  
  <p>Here is my code(In C language):</p>
  
  <pre><code>printf("hello, world");
  sleep(1);
  printf("Good, bye!");
  </code></pre>
  
  <p>After compiling and running the program, it seems that it will <strong>sleep first</strong> and then print "hello, worldGood, bye!"</p>
  
  <p>However, if using puts() instead of printf(), it will print "hello, world" then sleep, and finally print "Good, bye".</p>
  
  <pre><code>puts("hello, world");
  sleep(1);
  puts("Good, bye!);
  </code></pre>