Question: Given below is a program that finds the common clements in given two 10-element integer array(Array1 and Array2), and stores these common elements in a
Given below is a program that finds the common clements in given two 10-element integer array(Array1 and Array2), and stores these common elements in a third array called commonArray. Fill in the blanks to help the program work as it should. Note that this program catches all shared elements, even though they may appear at different indexes in these two arrays. For example, if Array1={1.2) and Array2-(2,1). commonArray will contain (1,2). int maino int Array1 - 15,6,7, 33, 55, 34, 99, 100, 45, 4); int Array2 = (13.4, 6, 11, 9.7.5.2.55,88); int commonArray[10] - / at most all 10 elements will be common. so reserve a 10-element array int commonindex 0; for(int i;i 2 printe The total number of common elements is ".commonindex printfr Common elements are: for (int i=0; commonindeci++) 4 print
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
