title: Reversing the array(without using a second array)
body: <p>I'm trying to reverse an array without using any second array.
  Here's the code I've written, but for some reason it doesn't seems to be working.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  void getarrayvalues();
  void main()
  {
   int k,n;
   int i=0;
   int a[100];
   printf("Enter the value of n");
   scanf("%d", &amp;n);
   printf("Ener the values of array");
   for(i=0;i&lt;n;i++)
   {
     scanf("%d", &amp;a[i]);
   }
   k=n;
   if(n%2==0)
   {
     for(i=0;i&lt;n;i++)
     {
        a[i]=a[k];
        k--;
     }
   }
   else
   {
     for(i=0;i&lt;n;i++)
     {
       if(k==((n/2)+1))
       {
         continue;
       }
       else
       {
         a[i]=a[k];
         k--;
       }
     }
   }
   printf("reverse values are");
   for(i=0;i&lt;n;i++)
   {
    printf("%d", a[i]);
   }
  }
  </code></pre>
  
  <p>After entering the array values, it returns to the blue code writing screen and doesn't prints the output.
  Any ideas ?</p>