Question: Write a complete C program consisting of a main and a function named FindCommon that do the following: FindCommon takes three integer arrays A, B

Write a complete C program consisting of a main and a function named FindCommon that do the following: FindCommon takes three integer arrays A, B and C and their size (they all have the same size). It then finds the common elements between A and B and stores them into C. FindCommon then returns the number of elements stored in C. For example, if A is [5 3 4 7 2] and B is [2 5 8 4 6], FindCommon stores [5 4 2] in C and returns 3 (the number of common elements that it stored in C). The order of elements in C does not matter, and it will be OK if C has duplication The main creates three arrays A, B and C with size 1000 and fills A and B with random numbers. The main then calls FindCommon and passes A, B, C and 1000 to it. The main finally prints the common elements that FindCommon stores in array C.

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!