Write a C++ program to input elements in an array and sort the array elements in descending order. Learn how to sort an array in descending order using pointers. Use a function to print out the original and sorted arrays.
Example:
Input the size of the array: 10
Input array elements: 20, 2, 10, 6, 52, 31, 0, 45, 79, 40
Output: Array sorted in descending order: 52, 45, 40, 31, 20, 10, 6, 2, 0