KASUS 6.1

1.) C++
#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,i;
    float num[10], sum, average;
    cout<<" masukan data : ";
    cin>>n;
    for(i=1;i<=n;++i){
        cout<<endl<<i+1<<"masukan no : ";
        cin>>num[i];
        sum+=num[i];
      
    }
    cout<<endl<<"sum = "<<sum;
    average=sum/n;
    cout<<endl<<"average = "<<average;
    return 0;
}

 2.)RAPTOR 




Share this

Related Posts

Previous
Next Post »