Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C programming, Please follow the instructions below. Here are is the first .txt called list1.txt (its not all of it but a good chunk) 403

C programming, Please follow the instructions below.

image text in transcribed

image text in transcribed

Here are is the first .txt called list1.txt (its not all of it but a good chunk)

403 1699 1738 3027 3237 4433 4443 5043 5553 5845 6799 7185 7952 8011 9719 10967 11693 11730 11952 12996 13158 14207 14588 15713 16230 16428 16520 16840 17012 17697 18230 18521 19797 20315 20506 21075 21702 22347 23764 24075 24847 26390 26547 26662 27588 27721 28961 28963 29265 31845 33820 34345 34412 34735 35014 36334 36484 36775 38202 39147 39222 40223 41913 42298 42761 43960 44268 46544 47246 47299 47983 48855 50319 50399 51009 51986 52336 54564 55535 55731 55922 56433 56548 56816 57919 58605 58606 59441 59651 60269 60490 60891 60948 61676 62262 62388 62454 63926 64927 65669 66051 67232 67828 68344 68451 68819 69263 70017 71125 71211 71387 71939 72186 73284 73631 75186 75409 75649 76248 76613 78960 79458 79962 80317 80423 81323 81413 81883 

Here is the second file called list2.txt (again not all of it)

1335 1787 1998 3328 4033 4292 4907 5018 5140 5330 5793 5844 6005 6019 6063 6716 7618 9262 10225 15025 15434 15642 15809 15814 16261 16359 16645 17422 17682 17766 19728 20464 21414 23066 23353 23608 23805 24461 25104 25169 26484 27776 28130 28346 28413 28717 30733 30780 30908 31025 32030 33361 34359 34757 35087 35133 37016 37168 37835 38657 40387 41032 41116 41994 42666 42808 42912 43184 43591 43735 44189 44494 45195 46011 46182 46327 48434 50353 51542 51615 52333 52731 54322 54572 54626 54878 55216 55375 55389 57013 58618 59404 59910 60112 60721 60822 61756 62304 62743 62767 63667 64209 64339 64640 64670 65189 65195 65622 65712 66457 67139 67560 68243 69192 69530 69622 70465 72436 72439 74717 74947 75302 76282 76735 78308 79307 79487 79512 80193 80364 81012 81350 81996 82362 82924 83745 84186 85157 85633 86532 87462 88402 89527 90841 90941 92714 92880 93578 93711 93752 94031 94704 94831 94850 95305 96353 96436 97414 97587 98335 98515 98637 100809 101441 101631 102030 103041 104103 104432 104440 105739 105883 106567 106736 108201 108263 108481 108644 110465 110720 111468 113352 114002 114216 115067 116536 117610 119640 120005 120443 120806 121238 122445 122552 122613 123778 123953 124743 126881 127140 127298 127471 127885 128413 
Write a C program mergeSort.c that accepts three strings as parameters from the command line in main). These three strings are names of three files with the first two files containing each a sorted list of numbers separated by spaces. The program performs the following operation: a. open the first two files as input files for reading data in text mode b. create a new text file as the output file using the third string as the file name c. read from the first file a number and store it in n1 d. read from the second file a number and store it in n2 e. append the smaller of the two numbers to the output file f. read the next number from the input file and then if n1 was smaller, read from the first file the next number and put it in n1 if n2 was smaller, read from the second file the next number and put it in n2 g. continue with step e h. if in step f. the input file contains no more numbers, i.e. the end of the file was reached, append the remaining numbers of the other file to the output file i. close all files and terminate the program Your main function should take command line arguments int main(int argc, char *argv[])

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probability & Statistics For Engineers & Scientists

Authors: Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying

7th Edition

9789813131279, 130415294, 9813131276, 978-0130415295

Students also viewed these Databases questions

Question

Recognize the four core purposes service environments fulfill.

Answered: 1 week ago