Write a method called median that accepts an array of integers as its argument a
ID: 3643681 • Letter: W
Question
Write a method called median that accepts an array of integers as its argument and returns themedian of the numbers in the array. The median is the number that will appear in the middle if
you arrange the elements in order. Assume that the array is of odd size (so that one sole element constitutes the median) and that the numbers in the array are between 0 and 99
inclusive.
Explanation / Answer
#include #include void bubble(int a[],int n) { int i,j,t; for(i=n-2;i>=0;i--) { for(j=0;ja[j+1]) { t=a[j]; a[j]=a[j+1]; a[j+1]=t; } } }//end for 1. }//end function. int main() { int a[100],n,i,Med; clrscr(); printf(" Enter integer value for total no.s of elements to be find Median ( Must Be ODD Number): "); scanf("%d",&n); for( i=0;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.