This is the most efficient function to find minimum and maximum value of a array, although comparisons in if conditions will take constant time but it will be compared n times because of the for loop, thus complexity is O(n), there is no way to find directly the minimum and maximum value in an array.
void find MinAndMax(int A[ ], int n){
int min=328664,max=-328664
for(int i=0;i<n;i++){
if(A[i]>max)
max=A[i];
if(A[i]<min)
min=A[i];
printf("minimum=%d and maximum =%d",min,max);
}
}