/* Median - Calculate median of an array of n numbers */ #include #include #include float median(int x[ ], int n) ; void sort(int x[ ], int n) ; void main() { int i, n, x[50] ; clrscr(); printf("Enter the number of elements: ") ; scanf("%d", &n) ; printf("Enter the elements: \n") ; for(i=0 ; i x[j+1]) { temp=x[j] ; x[j]=x[j+1] ; x[j+1]=temp ; } } /* Output1: Enter the number of elements: 5 Enter the elements: 2 8 4 9 6 The median of given numbers is 6.000000 Output2: Enter the number of elements: 6 Enter the elements: 2 9 4 8 6 7 The median of given numbers is 6.500000 */