Question: 1. Write a program in C to sort element of an array in ascending AND descending order. Keep original array unchaged, create two new arrays.
1. Write a program in C to sort element of an array in ascending AND descending order. Keep original array unchaged, create two new arrays.
1. one array for descending order
. 2. one array for ascending order.
CODE SKELETON
#define _CRT_SECURE_NO_WARNINGS #include
Your program should accomplish the following: a. Ask user for the size of the array and use a loop to fill the array with values. b. Using loops, sort the values of the array in descending and ascending order which will be saved into your two separate arrays.
(You can utilized 2 nested loops to perform the sorting) You will also utilize a conditional statement to perform the sorting correctly. c. Print the both arrays to the screen (using loops). Showing both ascending and descending orders. d. Code should be uploaded as a .txt file and a screenshot of the screen displaying your array is required. e. Provide comments that explain the basic logic of your loop structure and how it performs sorting or points will be taken off.
In mathematics, the factorial of a non-negative integer n, denoted by n!. n!, is the product of all positive integers less than or equal to n.
note: (0! = 1)
Ex.
4! = 4*3*2*1 = 24
5! = 5*4*3*2*1 = 120
n! = n*(n-1)*(n-2)*. . .*3*2*1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
