title: C program to find missing integer in a sequence of numbers
body: <p>You are given a sequence of n-1 distinct positive integers, all of which are less than or equal to a integer ‘n’. You have to find the integer that is missing from the range [1,2,...,n]. Solve the question without using arrays.</p>
  
  <p>Input Format:
  One line containing the integer ‘n’ where 2&lt;=n&lt;=10,000
  First line is followed by a sequence of ‘n-1’ distinct positive integers. Note that the sequence may not be in any particular order.</p>
  
  <p>I got code by using arrays</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main()
  {
   int i,j,n[9999],m,t;
   scanf("%d",&amp;m);
   for(i=1;i&lt;m;i++)
    {
     scanf("%d",&amp;n[i]);
    }
   for(i=1;i&lt;m;i++)
    {
     for(j=1;j&lt;i;j++)
      {
        if(n[j]&gt;n[j+1])
         {
           t=n[j];
           n[j]=n[j+1];
           n[j+1]=t;
          }
      }
     }
     for(i=2;i&lt;m;i++)
      {
       if(n[i-1]!=n[i]-1)
         {
            printf("%d",n[i]-1);
            break;
         }
    }
   return(0);
   }
  </code></pre>
  
  <p>How can I do the same without using arrays?</p>