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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started