Question: C# programming Write a function that returns the second largest number in a field of integers. Note that since the array in C does not

C# programming

Write a function that returns the second largest number in a field of integers. Note that since the array in C does not know how big they are, your function must take two argument: partly array, and partly an integer indicating the number of elements in it. (Your function should therefore not load input from the user with scanf or similar.) You can assume 3 that the input consists of an array with at least two numbers. If all the numbers are equal, so be it there is something that is second largest, so you can return that number instead. For example: given an array with the content [10,20,2,50,50,0] your algorithm should return 20 and I main you should call the function four times, with appropriate test cases. Enter both test inputs and expected output, and also include a printout (with printf) showing if all the tests have been successful or not. Remember to cover four different interesting cases!

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!