#include<iostream>
#include<conio.h>
#include<string>
using namespace std;
void main(){
float nilai[5];
for (int a=0;a<=4;a++){
cout<<"Masukan nilai ke-"<<a+0<<":";cin>>nilai[a];
}
float total=0;
cout<<"Hasil dari: ";
for(int a=0;a<=4;a++){
total+=nilai[a];
cout<<nilai[a];
if (a<4){
cout<<"+";
}
}
cout<<" adalah: "<<total<<endl;
float rata2=0;
for(int a=0;a<=4;a++){
rata2=total/5;
}
cout<<"Rata-Ratanya:"<<rata2;
_getch();
}
Minggu, 29 Mei 2011
Langganan:
Posting Komentar (Atom)
Comments :
0 komentar to “Program”
Posting Komentar