#include <stdio.h>
void minmax(int ara[],int n,int *min,int *max){
int i;
*max=*min=ara[0];
for(i=1;i<n;i++){
if(ara[i] < *min){
*min=ara[i];
}
if(ara[i] > *max){
*max=ara[i];
}
}
}
int main()
{
int n,i;
printf("How many elements do you want in you array:\n");
scanf("%d",&n);
int ara[n];
for(i=0;i<n;i++){
scanf("%d",&ara[i]);
}
printf("\n");
printf("The created array is:\n");
for(i=0;i<n;i++){
printf("%d ",ara[i]);
}
printf("\n\n");
int min,max;
minmax(ara,n,&min,&max);
printf("The maximum value of the array is : %d and the minimum value of the array is %d\n",max,min);
return 0;
}