title: C Program to display the highest and lowest entered numbers. Programming Beginner
body: <p>I'm taking a C programming class this semester and I have absolutely no programming experience, this is making it extremely difficult for me to do the assignments or even study.</p>
  
  <p>the assignment is to write a program that will allow the user to input any amount of values and display the largest and smallest values that were inputted. </p>
  
  <p>it has to accept positive and negative number and entering 0 will terminate the program. </p>
  
  <p>if the first number entered is 0 then a message stating this must be displayed.</p>
  
  <p>this may be quite laughable to some of you, but here is what I have.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void)
  
  { 
  
  float max=0, a;
  float min=0, b;
  
  printf("Entering 0 will terminate the sequence of input values.\n");
  
  do{ printf("Enter Number:");
  
      if (scanf(" %f", &amp;a)==1);{
  
      if(a&lt;max){
  
          a=max;}
  
      if(a&gt;min){
  
          a=min;}
  
      }
  
  } while(a!=0);
  
  printf("Your largest number was %.3f. Your smallest number was %.3f.", max, min);
  
  return 0;
  }
  </code></pre>
  
  <p>also, can any of you recommend and reference materials that will help me learn this stuff, thank you.</p>