title: How to remove line breaks after "ctime" in C program?
body: <p>Please bear with me since I'm still really new to C programming. When I run this code:</p>
  
  <pre><code>#include &lt;time.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;unistd.h&gt;
  
  int main(void)
  {
      while (1) {
          time_t mytime;
          mytime = time(NULL);
          printf("%s Hello world\n", ctime(&amp;mytime));
          sleep(1);
      }
      return 0;
  }
  </code></pre>
  
  <p>The output always looks like this:</p>
  
  <pre><code>Wed Jan 18 02:32:32 2017
   Hello world
  Wed Jan 18 02:32:33 2017
   Hello world
  Wed Jan 18 02:32:34 2017
   Hello world
  </code></pre>
  
  <p>What I want is like this:</p>
  
  <pre><code>Wed Jan 18 02:32:32 2017 Hello world
  Wed Jan 18 02:32:33 2017 Hello world
  Wed Jan 18 02:32:34 2017 Hello world
  </code></pre>
  
  <p>How can I do that ?</p>
  
  <p>Note:
  If I remove <code>\n</code> from <code>printf("%s Hello world\n", ctime(&amp;mytime));</code> it'll result like this:</p>
  
  <pre><code>Wed Jan 18 02:38:29 2017
   Hello worldWed Jan 18 02:38:30 2017
   Hello worldWed Jan 18 02:38:31 2017
   Hello worldWed Jan 18 02:38:32 2017
   Hello worldWed Jan 18 02:38:33 2017
  </code></pre>