Question: Has to be done in C, using arrays and for loops if they are needed Please give the C code Write a function avgLast that

Has to be done in C, using arrays and for loops ifHas to be done in C, using arrays and for loops if they are needed

Please give the C code

Write a function avgLast that returns as a double-precision number the average of last n elements of an array, assuming n is appropriately sized. The function has the following inputs, in this order: an array of integers an integer number of elements an integer n Sample Test Case Property Value Input array {1, 3, 6, 8, -200, 31, 31} Input n 3 Output -46.0 You should write the main function so that you can perform appropriate tests on the avglast function. It's up to you to decide what code you write in main to perform the testing but you need to consider more test cases other than the sample test case given above

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!