#include <iostream>
using namespace std;
#define Max 1000
int main()
{ int i=0,n=0,max=0,min=0;

int a[Max];
cout<<"Program to find Maximum and Minimum from array element\n";
cout<<"Enter the size of array\t=\t";cin>>n;
cout<<"Enter array element\n";
for(i=0;i<n;i++)
{
    cin>>a[i];
}

max=a[0];
min=a[0];
for(i=1;i<n;i++)
{
    if(max<a[i])
    {
        max=a[i];
    }
    else if(min>a[i])
    {
        min=a[i];
    }
}
cout<<"Maximum Element\t=\t"<<max<<endl;
cout<<"Minimum Element\t=\t"<<min;
}
