Question: Code in c (ill post the question again if these pictures are not clear enough) Spring 2019 Passing arrays to functions Symbolic constants Expand the
Code in c
(ill post the question again if these pictures are not clear enough)



Spring 2019 Passing arrays to functions Symbolic constants Expand the prelab Submit this assignment by folowing the or executable Sile is instructions given by your TA SUBMIT ONLY the c file (no a.out required) Use the following submit command Filename must be sectionletter-labs.c (Use your lab section for section-letter) For the lab assignment, you need to define a symbolic constant called LIMIT that will be equal to 10 You should declare two arrays, both of type int in your main) function that have LIMIT elements (note that you must use the symbolic constant in your declaration of each array, as well as every time you need to reference the number of elements in each array). Initialize the first array so that the value o each element is equail to that element's subscript times itself. For example: firstarray[3]-9 (because 9 -33) nitialize the second array so that the value of each element is equal to that element's subscript. example 3 secondarray[3] will write a function to do each type of initialization, as described below. nce your arrays are initialized, you should pass them each to PrintArray0), and then pass th each of the functions SumArrays) and MultArrays0. These three functions are describe ou Functions You Must Write You may write any functions you wish to implement this program, in addition to the following functi However, you must implement the following functions: void InitArraySquarelint arrayl, int size) -This function takes an array that has size element The value of each element in the array is set to the value of its subscript squared. void InitArrayLine The value of each element in the array is set to the value of its subscript. arlint arrayll, int size)- This function takes an array that has size elements void PrintArraylint arrayl, int size) -This function takes an array that has size elements. The value of each element in the array is printed tion takes two arrays that e void SumArrays(int array1l1, int array2l, int size) - This func The value of the sum of the corresponding element in the arrays is ach printed have size elements. void MultArrays(int array1ll, int array21, int size)-This functio have size elements. The value of the product of the corresponding element in the arr printed. n takes two arrays that each int main(void)-Of course, you need to write a mainl) . ample Out mk@iirnRAr Dut Array 1: Array 2: Sum of elements of arrays: 12 20 42 72 Product of elements of arrays: 2 216 512 Guidelines for Grading Lab S 40 Points Possible t+5 bonus points) General 5 points: Header and general coding style 5 points: Output matches the samplie output correctty 5 points: InitArray LinearO function 5 points: PrintArrayO function 5 points: SumArrays) function 5 points: MultArrays0 function. 5 points: main0 function BONUS (5 points) Write a new function called InitAmay Power void InitArrayPower(int elements. The arrayll, int size, int power)- This function takes an array that has value of each element in the array is set to the value of its subscript raised power specified. Change your InitArraySquareD and InitArraylinear) functions to call InitArrayPower) instead
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
