Given an array having three numbers sort the array