Code:
#include <stdio.h>
#include<conio.h>
void main()
{
int a [100]; /* Array Declaration */
int i,n,max,mini;
printf("Enter number of elements in the array");
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
max=a[0];
mini=a[0];
for(i=1;i<n;i++)
{
if(max<a[i])max=a[i];
if(mini>a[i])mini=a[i];
}
printf("\nMaximum element in the array is %d",max);
printf("\nMinimum element in the array is %d",mini);
getch();
}
This is the 'Turbo C' version of your program, you need to include conio.h and use getch() at the LAST line.