PROGRAM MENCRI RATA-RATA NILAI POSITIF INTEGER
01.02
By
Unknown
KASUS 4
0
komentar
MENCRI RATA-RATA NILAI POSITIF INTEGER
#include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
int n=1;
float r,x,o,j=0;
cout<<"data ke-1 : ";cin>>o;
while(n<10){
cout<<"data ke- : "<<n+1<<"=";
cin>>x;
j+=x;
n++;
}
float h=j+o;
cout<<"jumlah ="<<h<<endl;
cout<<"rata-rata ="<<h/n;
return 0;
}
RAPTOR :
0 komentar: