C Source Code/Sorting array in ascending and descending order