Statistika Tuga 1.docx

  • Uploaded by: Munifah Nur Fadhilah
  • 0
  • 0
  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Statistika Tuga 1.docx as PDF for free.

More details

  • Words: 81
  • Pages: 2
#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; }

Related Documents

Statistika Tuga 1.docx
October 2019 12
Statistika
June 2020 31
Statistika
April 2020 16
Statistika
April 2020 25
Statistika
November 2019 34
Statistika
April 2020 23

More Documents from ""

Projek Bindo 7.docx
October 2019 24
Statistika Tuga 1.docx
October 2019 12
Si Ebay.docx
October 2019 10
Alice In Wonderland.docx
October 2019 9