Question: Please write the program in C, given the requirements below. Here is the code for sortMain.c that you can copy and paste: #include #include #include
Please write the program in C, given the requirements below.

![#include "mysort.h" int main(int argc, char * argv[]) { int data[100000]; /*](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3b79733707_27866f3b796c6cd1.jpg)


Here is the code for sortMain.c that you can copy and paste:
#include #include #include "mysort.h" int main(int argc, char * argv[]) { int data[100000]; /* Array of ints to sort */ int nDataItems; /* number of actual items in the array */ int i; /* Test data */ nDataItems = 4; data[0] = 10; data[1] = 20; data[2] = 30; data[3] = 40; mySort(data, nDataItems); /* Check that the data array is sorted. */ for(i = 0; i data[i+1]) { fprintf(stderr, "Sort error: data[%d] (= %d)" " should be Problem statement (Version 1) Suppose that the requirements for a lab were: 1. A main() function in a file named sortMain.c uses a hardcoded array of integers, invokes a function called my Sort() and prints the sorted values to stdout. 2. The main() function must invoke the sorting method as: mySort (int datall, unsigned int n); 3. The source file sortMain.c must include the file mySort.h which contains: * DO NOT EDIT */ void mySort(int array(), unsigned int num_elements); Furthermore, you must provide a mysort() function that conforms to this signature in a file named mySort.c. Tutorial I (Initial stab at lab) Clearly, we need three files: mySort.c, mySort.h and sortMain.c. Luckily, mySort.h has been furnished; as well, templates for sortMain.c and mySort.c are given. There are two general approaches we could now take: 1. Write an implementation of mySort.c and modify sort Main.c to test it. 2. Modify sort Main.c so that it can test any implementation of the mySort We opt for the second approach. What should main(do? The main routine must: Declare and initialize the data to be sortedie, an array of integers. Invoke the mySort function with the proper parameters: the data array name and the number of items to be sorted. Once the sorting function returns, it should print the sorted array to stdout. While these are necessary requirements, the main() could do more; in particular, After sorting the array, it could check that the data really is sorted. If it is not correctly sorted, it should inform the user of what problem was encountered and exit with a non- zero exit code The initial sortMaine module An implementation of the sortMain.c module is shown below: #include #include #include "mysort.h" int main(int arge, char. argv11) int data[100000); / Array of ints to sort / int nDataItems; umber of actual items in the array/ inti: /* Test data / nDataItems - 41 data101 - 10; data[1] - 20: data[21 - 30; data[31 - 40; mySort (data, nDataItems); /* Check that the data array is sorted. / for (i = 0; i data[1+21) fprintf(stderr, "Sort error: data[id] (- $d)" " should be