Question: C programming language 4. (10 points) Consi elaration: double a[10] = { 1.2, 2.1, 3.3, 3.5, 4.5, 7.9, 5.4, 8.7, 9.9, 1.0 Write a function
4. (10 points) Consi elaration: double a[10] = { 1.2, 2.1, 3.3, 3.5, 4.5, 7.9, 5.4, 8.7, 9.9, 1.0 Write a function named out_of_ order that will test this array or any array of doubles for the condition The function returns the index of the first element that is out of order, or -1 if the elements are in order. The function should work for an arbitrary array of doubles. Be sure to explain how you avoid illegal array indexes (i.e., out-of-bounds array accesses). For example in the sequence above, 7.9 is not less than or equal to 5.4 and so it appears to be out of order
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
