/* q23.c

 Incorrect Answer to Question 23, CISC105 Exam 2, Fall 2004 
 P. Conrad  

*/

#include <stdio.h>

int main(void)
{
  int i; /* loop counter */
  int a[10]; /* array with 10 elements */
  int min = a[0]; /* 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]);
      if (a[i] < min)
	min = a[i];
    }
  printf("\nmin is: %d\n",min);

  return 0;
}



