Dan ini untuk Program C++ dari Perulangan Rata - rata :
#include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
int n;
int rata;
int x;
int i;
float jumlah;
raptor_prompt_variable_zzyz ="masukan n=";
cout << raptor_prompt_variable_zzyz << endl;
cin >> n;
jumlah =0;
i =1;
while (!(i>n))
{
raptor_prompt_variable_zzyz =" masukan x=";
cout << raptor_prompt_variable_zzyz << endl;
cin >> x;
jumlah =jumlah+x;
i =i+1;
}
rata =jumlah;
cout << rata << endl;
system("pause");
return 0;
}
Tidak ada komentar:
Posting Komentar