Question: Program 2: Merge two arrays Write a Pascal program that does the following: 1. Read the following two lines of integers from the standard input

 Program 2: Merge two arrays Write a Pascal program that does

Program 2: Merge two arrays Write a Pascal program that does the following: 1. Read the following two lines of integers from the standard input (such as your keyboard) into two integer arrays: 1 5 9 12 16 21 25 3 7 12 13 14 15 16 19 20 26 The numbers are separated by one or more blanks. Keep reading integers until the end of the line. You may assume that there are no errors in the input data and each line of integers is properly sorted in ascending order. Each array should be large enough to hold up to 20 values. 2. Pass each array by reference to a Print routine that prints the array values. 3. Pass the two arrays and a third initially empty array by reference to a Merge routine. The routine merges the two arrays and stores the merged values (which should be sorted) into the third array. The third array should be large enough to hold up to 40 values. 4. Pass the merged array to the Print routine

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!