title: Loop gets terminated without any error
body: <p>well I have been trying to write this program which accepts any number of integers until the condition is true using do while loop but the loop gets terminated even if the condition is met.I am not able to understand the flaw in my code... I would be thankful for any help</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  int main()
  {
      int max,min,test;
      char next;
      printf("enter an integer:\n");
      scanf("%d",&amp;max);
      min=max;
      do
      {
          printf("enter next integer:\n");
          scanf("%d",&amp;test);
          if(test&gt;max)
              max=test;
          else if(test&lt;min)
              min=test;
          printf("want to enter next number y/n\n");
          scanf("%c",&amp;next);
      }while(next=='y');
      printf("Maximum=%d\nMinimum=%d\nRange=%d\n",max,min,max-min);
      getch();
  }
  </code></pre>