title: Printing min and max using a EOF loop
body: <p>I am having difficulty writing a C program that reads real numbers from standard output and determines whether the number is max or min compared to all other numbers that were read previously. The program should read another real number until EOF occurs. Below is my attempt at the problem:<br></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
      double maximum = 0, minimum = 0, number;
      while (number != EOF) {
          printf("Enter a number: ");
          scanf("%lf", &amp;number);
          printf("%d", EOF);
          if (number &gt; maximum) {
              maximum = number;
          }
          else if (number &lt; minimum) {
              minimum = number;
          }
      }
      printf("\n Max number is: %lf", maximum);
      printf("Min number is: %lf", minimum);
      return 0;
  }
  </code></pre>
  
  <p><br> The challenge is that I'm not allowed to use arrays. </p>