c++ function to find minimum element in array

C++
for maximum element

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

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

Also in C++: