#include <cstdlib>
#include <iostream>
using namespace std;
int pangkat (int a, int n)
{
int k, hasil;
hasil=1;
for (k=1; k<=n; k++){
hasil *= a;
}
return hasil;
}
int main(int argc, char *argv[])
{
cout<<pangkat(2,3)<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#include <iostream>
using namespace std;
int pangkat (int a, int n)
{
int k, hasil;
hasil=1;
for (k=1; k<=n; k++){
hasil *= a;
}
return hasil;
}
int main(int argc, char *argv[])
{
cout<<pangkat(2,3)<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
No comments:
Post a Comment