#include <cstdlib>
#include <iostream>
using namespace std;
class pangkat {
int x,n,hasil ;
public:
void input(){
cout<<"masukan angka:";
cin>>x;
cout<<"masukan pangkat :";
cin>>n;
int i=1;
hasil = 1;
for (int i=1; i<=n; i++){
hasil= hasil*x;
}
cout<<"hasil :"<<hasil<<endl;
}
};
int main(){
pangkat p;
p.input();
system("PAUSE");
return EXIT_SUCCESS;
}
Saturday, March 3, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment