#include <iostream>
#include <math.h>
using namespace std;
float pangkat(int x, int y)
{
return(exp(y*log(x))); }
main() {
float
hasil;
int a, b;
cout
<< "Menghitung hasil perpangkatan\n";
cout
<< "Tulis sebuah bilangan : "; cin >> a;
cout
<< "Mau dipangkat berapa :
"; cin >> b;
hasil = pangkat(a,b);
cout
<< a << " pangkat " << b << " =
" << hasil;
return
0;
}
Sign up here with your email
ConversionConversion EmoticonEmoticon