Question: Question 7 (a) Briefly explain why the following C function: void swapl(int x, int y)( int temp; ytemp will fail to swap the values of

Question 7 (a) Briefly explain why the following C function: void swapl(int x, int y)( int temp; ytemp will fail to swap the values of it's input variables but why the following function void swap2(int *x, int *y) int temp = *x; temp does perform a swap 5 marks] (b) Write a C function called max with the signature int max(int a], int length) that returns the maximum value in the array a. Assume that length contains the length of a. Also, in your answer you can assume that a contains no negative values and a has at least one element. 4 marks] (c) What is the largest number printed by the following code? Briefly ex plain your answer #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
