#include<stdio.h>
int main()
{
int a[1000],i,n,smallest,largest;
printf("enter the size of the array:");
scanf("%d",&n);
printf("enter elements in array:");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
smallest=largest=a[0];
for(i=1;i<n;i++)
{
if(smallest>a[i])
smallest=a[i];
if(largest<a[i])
largest=a[i];
}
printf("largest of the array is:%d",largest);
printf("smallest of the array is:%d",smallest);
return 0;
}