The "mean" is the "average" you're used to, where you add up all the numbers and then divide by the number of numbers. The "median" is the "middle" value in the list of numbers.
#include<stdio.h> #include<conio.h> void main() { int a[100],n,i,median; clrscr(); printf("Enter the Frequency :-"); scanf("%d",&n); printf("Enter %d Values of n :- ",n); for(i=0; i<n; i++) { scanf("%d",&a[i]); } if(n%2==0) { median=(a[(n+1)/2]+a[n/2])/2; } else { median=a[(n+1)/2]; } printf("Median :- %d",median); getch(); }