February 2020
Beginner to intermediate
616 pages
15h 16m
English
A macro called max is defined of size 100. Three arrays, p, q, and r, are defined of size max. You will first be asked to enter the size of the first array, p, followed by the sorted elements for array p. The process is repeated for the second array q.
Three indices, i, j and k, are defined and initialized to 0. The three indices will point to the elements of the three arrays, p, q, and r, respectively.
The first elements of arrays p and q, in other words, p[0] and q[0], are compared and the smaller one is assigned to array r.
Because q[0] is smaller than p[0], q[0] is added to array r, and the indices of arrays q and r are incremented for the next comparison as follows:
Next, p[0] will be compared with q[1] ...
Read now
Unlock full access