c++ function to find minimum element in array

for maximum element

int maximum = *max_element(A,A+n);

int minimum = *min_element(A,A+n);