#include<stdio.h>
temp=data[a];
#include<stdlib.h>
data[a]=data[b];
#include
data[b]=temp; }; };
int main () {
}
int n,a,b,temp=0,q1,q2;
if(n%2==1){q2=(n/2);
float median; printf("\t\t\tPROGRAM STATISTIKA\n\n");
median=data[q2]; printf("median adalah: %.2f",median);}
//input jumlah data else if(n%2==0){q1=(n/2)-1; q2=(n/2); printf("masukkan jumlah data: "); scanf("%d",&n);fflush(stdin); median=((float)data[q1]+(float)data[q2])/2; //input data int data[n],frekuensi[n],modus,max=1000,sum=0;
printf("\nmedian adalah: %.2f",median);}
float mean; printf("\n"); for(a=0;a: ",a+1);scanf("%d",&data[a]);
//mencari rata-rata
sum=sum+data[a];
mean=(float)sum/n;
}
printf("mean adalah: %.2f\n",mean); //mencari modus
printf("\n\n");
for(a=0;a<10;a++){frekuensi[a]=0; for(b=0;b
//median if(data[b]==a){frekuensi[a]=frekuensi[a]+1;}; for(a=0;a<(n-1);a++){ } for(b=a;b
if(frekuensi[a]>max) {max=frekuensi[a];modus=a;} };
printf("modus adalah: %d\n\n",modus);
system("pause"); return 0; }