#include <iostream.h> #include <conio.h> int main() { int data[100]; int n; float jumlah=0, rata; cout<<"Masukan Jumlah data: "; cin>>n; cout<<endl; for(int i=0;i<n;i++) { cout<<"Masukan Data["<<i+1<<"]:"; cin>>data[i]; } cout<<endl; for(int i=0;i<n;i++) { cout<<"Nilai a["<<i+1<<"]:"; cout<<data[i]<<endl; jumlah +=data[i]; } rata=jumlah/n; cout<<"Jumlah:"<<jumlah<<endl; cout<<"rata:"<<rata<<endl; getch(); return 0;
0 Response for the "Array Loping keyboard"
Post a Comment