Question: Please write the code in C, Thank you! 2) Sorting given set of integers (50 points) Write a C program, sort.c, that takes in a

Please write the code in C, Thank you!

Please write the code in C, Thank you! 2) Sorting given set

2) Sorting given set of integers (50 points) Write a C program, sort.c, that takes in a sorting option (-a or -d) and a list of integer numbers from the command line and sorts it accordingly. The option '-a' is for sorting in ascending order and -d' is for sorting in descending order Your program must: 1. Be invoked as: sort -al-d] See sample execution for examples. Assume that a maximum of 100 integers could be entered. 2. Print out the sorted integers Example executions: $ gcc -Wall -o sort sort.c $ ./sort -a 65 23 98 23 65 98 $ . /sort -d -95 -23 -11 98 98 -11 -23 -95

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!