title: 3rd character of the string is not reversing the code given below
body: <p>How can I assign third character to fourth character?</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  int main(void) {
  
      char a[50];
      int i,l,temp;
  
      setbuf(stdout,NULL);
      printf(&quot;enter a string&quot;);
  
      scanf(&quot;%s&quot;,a);
      l=strlen(a);
  
      for(i=0;i&lt;=l/2;i++){
          temp=a[i];
          a[i]=a[l-i-1];
          a[l-i-1]=temp;
      }
  
      printf(&quot;%s&quot;,a);
      return EXIT_SUCCESS;
  }
  </code></pre>
  <p>output:</p>
  <p>enter a stringamalks</p>
  <p>skalma</p>