Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Be t he new direetor mplement the program below in your lab08 directory Sorting

ID: 3677365 • Letter: B

Question

Be t he new direetor mplement the program below in your lab08 directory Sorting Arrays Part I Write a program that asks the user to enter a 10 integers and stores them in an array. Write a function (largest) that takes as input an array of int, the length of the array and a position in the array and returns the largest element of the array between the given position and the end of the array Your program should then ask the user for a position and use the function largest to return the largest element starting at that position, Compile and test your program Part II Modify your function, change its name to largestPos and update its code so it returns the position of the largest element foun user given position d. Adjust your program so it prints the largest element in the array starting at the Part III Write a program (sort.c) that asks the the sorts the array in decreasing order. Your program should do the following: user to enter a number of integers, stores them in an array, and r a number of integers, stores them in an array, and Ask the user to enter an integer between 2 and 15. This will represent the number of elements to in the array Check if the input is between 2 and 15. If not, your program should keep asking the user to enter an integer between 2 and 15 until a valid input is entered - - Ask the user to enter the specified number of integers Read those integers into an array Print the array before sorting Sort the array in decreasing order: (assume that the last index of the array is LAST) o Find the largest element of the array (use the function written in part ) o Swap the largest element with the element at position 0 o Find the largest element between position 1 and LAST o Swap the largest element with the element at position 1 o Find the largest element between position 2 and LAST o Swap the largest element with the element at position 2 o Repeat until all elements are sorted Print the array after sorting »:

Explanation / Answer

#include int main() { int array[100], maximum, size, c, location = 1; int position printf("Enter the number of elements in array "); scanf("%d", &size); printf("Enter %d integers ", size); for (c = 0; c
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote