/* q23.c

 Alternative answer to Question 23, CISC105 Exam, Fall 2004 
 P. Conrad  

*/

#include <stdio.h>

int main(void)
{
  int i; /* loop counter */
  int a[10]; /* array with 10 elements */
  int min; /* minimum element in array */

  /*  prompt user for ten integers */

  printf("Please enter ten integers: ");

  /* use scanf to get the integers and put the integers into an array */
  for (i=0; i<10; i++)
    {
      scanf("%d",&a[i]);
    }

  /* print out the array on a single line */
  printf("array is: ");
  for (i=0; i<10; i++)
    {
      printf("%d ",a[i]);
    }
  printf("\n");

  /* print the minimum value in the array */
  
  /* need to initialize min = ??? */

  min = 0;

  for (i=1; i<10; i++)
    {
      if (a[i] < a[min])
	min = i;
    }

  printf("min is: %d\n",a[min]);

  return 0;
}



