title: Program to reverse a string in c, but its printing a at the /0 position
body: <p>The program is as follows:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  int main(void) {
      setbuf(stdout,NULL);
      int l,i;
      char s[10],c;
      printf(&quot;Enter the string: &quot;);
      gets(s);
      l=strlen(s);
  
      for(i=0;i&lt;l/2;i++){
          c=s[i];
          s[i]=s[l-1-i];
          s[l-1-i]=c;
      }
      printf(&quot;The reversed string is: %s &quot;,s);
      return EXIT_SUCCESS;
  </code></pre>
  <p>}</p>
  <p>The output is:
  Enter the string: hello world.
  The reversed string is: hlrow olleo.</p>