Question: Program in C language Declare an array in main() called NumList of type integer and size MAX (define MAX as 20). ***RULE: From this point

Program in C language

Declare an array in main() called NumList of type integer and size MAX (define MAX as 20).

***RULE: From this point forward, you may NOT use the array operator [ ] anywhere else in your program (except when declaring the array).

Populate the array with increasing even numbers starting with 4. (example: 4, 6, 8, ...)

Display the Array contents. (Write a function for this, call it PrintArray that accepts the array to be printed and its size as parameters)

Triple the value of each element in the array. (use the function Triple from Part II)

Display the Array contents. (call your PrintArray).

Sort the array in any order as desired by the user (Write a function called BubbleSort that accepts the array, size, and sort order). (Use the function Swap that you designed in part II above.)(the Sort order is defined by a flag parameter in the function call - for instance, you can make the flag an integer and if it is equal to 1 then it sorts in ascending order, and if the flag is -1 then it sorts in descending order)

Display the SORTED Array in Ascending and Descending order (use PrintArray to display).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!