FlowChart Menentukan Pangkat

 

Pangkat
Pangkat

 

 

 

 

 

 

 

C++

 

#include <iostream>
#include <string>

using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float hasil;
int x,y,a;

raptor_prompt_variable_zzyz =”Masukan x : “;
cout << raptor_prompt_variable_zzyz << endl;
cin >> x;
raptor_prompt_variable_zzyz =”Masukan y : “;
cout << raptor_prompt_variable_zzyz << endl;
cin >> y;
a =1;
hasil =1;
while (!(a>y))
{
hasil =hasil*x;
a =a+1;
}
cout << “hasil = “<<hasil;
return 0;
}

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s