C Program to find the largest and smallest of N numbers

#include "stdio.h"
void main ()
{
  int i, j, n, a[20], max, min;
  clrscr ();
  printf ("Please enter the limit\n");
  scanf ("%d", &n);
  printf ("Please enter the numbers\n");
  for (i = 0; i < n; i++)
  {
    scanf ("%d", &a[i]);
  }
  max = a[0];
  min = a[0];
  for (i = 0; i < n; i++)
  {
    if (a[i] > max)
    {
      max = a[i];
    }
    else if (a[i] < min)
    {
         min = a[i];
    }
  }
  printf ("Largest number is %d\nSmallest number is %d", max, min);
  getch ();
}