<form action="/Dave/C/section2_5_7.html" METHOD="GET">
<input type="submit" value="Return to exercise">
</form>
 
The Solution is: 
<pre>
/* maxmin.c - program that works out the largest and smallest values
                from a set of 10 inputted numbers  */
		

#include <stdio.h>

      
main()

{  float in, max = -1000000.0, min = 1000000.0; /* initial large numbers */
   int i;
   
   for (i=0;i<10;++i)
     {  printf("Enter number %d: \n", i+1);
        scanf("%f",&in);
        
        if ( max < in )
          max = in; /* in is current largest */
          
        if ( min > in )
          min = in; /* in is current smallest */
          
      }
      
   printf("\nLargest = %10.3f, Smallest = %10.3f\n", max, min);
           
   exit(0);
}
</pre>
<form action="/Dave/C/section2_5_7.html" METHOD="GET"> 
<input type="submit" value="Return to exercise">
</form>  
 
