Question: Programming in C question!!!!!!! I did part 1&2 together, and part 3 seperate. apparently part 3 is the only code needed to be submitted. i

Programming in C question!!!!!!! I did part 1&2 together, and part 3 seperate. apparently part 3 is the only code needed to be submitted. i put together the code, but it doesnt work :/

-attached are the directions

//PART1&2 #include #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 < size; c++)

scanf("%d", &array[c]); printf(\u201center a given position\u201d); scanf("%d", &position);

largest(array,size,position); void largest(int array[],int size,int position) { maximum = array[position]; for (c = position; c < size; c++) { if (array[c] > maximum) { maximum = array[c]; location = c+1; } } printf("Maximum element is present at location %d and it's value is %d. ", location, maximum); return 0; }}

//PART3

#include void main() { int i, j, a, n, number[30]; do { printf("Enter the value of N :"); scanf("%d", &n); if(n>=2&&n<=15) { break; } else { printf(" Error: value must be 2 to 15 Try Again..."); } } while(1); printf("Enter the numbers "); for (i = 0; i < n; ++i) { scanf("%d", &number[i]); } printf("Before Sorting:"); for (i = 0; i < n; ++i) printf("%d ", number[i]); printf(" "); for (i = 0; i < n; ++i) { for (j = i + 1; j < n; ++j) { if (number[i] < number[j]) { a = number[i]; number[i] = number[j]; number[j] = a; } } } printf("After Sorting:"); for (i = 0; i < n; ++i) printf("%d ", number[i]); }student submitted image, transcription available below

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!