Question: USE C PROGRAMMING LANGUAGE You have to write a program that will read an array from a file and sort the given array. You will

USE C PROGRAMMING LANGUAGEUSE C PROGRAMMING LANGUAGE You have to write a program that will

You have to write a program that will read an array from a file and sort the given array. You will return the array sorted with all even numbers in ascending order at the front followed by all odd numbers in ascending orde:r You can use any sorting algorithm you know or wish to use. However, you cannot use the library sort functions. You should write your own sort function Input-Output format: Your program will take the file name as input. The first line in the file provides the total number of values in the array. The second line will contain a list of numbers separated by tabs. For example a sample input file "filel.txt" is: 25 10 1 99 4 2 Your output will be the sorted list of numbers, even numbers and then odd numbers, each separated by tabs $./first file1.txt 2 4 10 1 25 99 We will not give you improperly formatted files. You can assume all your input files will be in roper format as above. Hint: It may be helpful to sort all even numbers to the front of an array first and then sort them

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!