Question: this is c program problem. please help me to solve this one. I already got one #include void find_two_largest(int a[], int n, int *largest, int
this is c program problem. please help me to solve this one.

I already got one
#includevoid find_two_largest(int a[], int n, int *largest, int *second_largest) { int i; if (a[0] > a[1]) { *largest = a[0]; *second_largest = a[1]; } else { *largest = a[1]; *second_largest = a[0]; } for (i = 2; i *largest) { *largest = *second_largest; *second_largest = a[i]; } else if (a[i] > *second_largest) { *second_largest = a[i]; } } } int main() { int largest, second_largest; int arr[] = {3, 1, 8, 4, 2, 5}; find_two_largest(arr, sizeof(arr)/ sizeof(int), &largest, &second_largest); printf("Largest value is %d ", largest); printf("Second Largest value is %d ", second_largest); return 0; }
But Would you please write a new different one??
Thank you so much
Write the following function: void find_two_largest(int al. int n, int "largest, int "second_largest): When passed an array a of length n, the function will search a for its largest and second largest elements, storing them in the variables pointed to by largest and second_largest respectively Write down the complete C program for the above scenario. Each C file should also have your name and date with the lab number in the header at the top of the file. The purpose of the program should be clearly mentioned in the header. Each C file should have adequate comments that describe the program statements. All code should be neat and properly indented/formatted
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
