Write function boolean isSorted(int a[], int size). The func…

Questions

Write functiоn bооleаn isSorted(int а[], int size). The function returns true if аrray a is sorted in either ascend order or descend order; false otherwise.