Following is the program to find the minimum and maximum number in an array as per the input from the user :
#include<stdio.h>
int main(){
int n;
printf("Enter the length of array ");
scanf("%d",&n);
int a[n];
printf("Enter the elements of array\n");
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
int m = a[0];
for(int j=0;j<n;j++){
if(a[j] > m){
m = a[j];
}
}
printf("Maximum: %d\n",m);
m = a[0];
for(int k=0;k<n;k++){
if(a[k] < m){
m = a[k];
}
}
printf("Minimum: %d",m);
return 0;
}