Gerakan Digital

Selasa, 05 April 2016

Kasus 5.3 - Alpro



Dev c++ 5.3
 #include <iostream>
#include <math.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
float pangkat(int x,int y)
{ return(exp(y*log(x)));
}
int main(int argc, char** argv) {
 float hasil;
 int a,b;
 cout<<"=====menghitung hasil perpangkatan======\n"<<endl;
 cout<<"tulis sebuah bilangan: ";cin>>a;
 cout<<"mau dipangkat berapa: ";cin>>b;
 hasil=pangkat(a,b);
 cout<<a<<" pangkat "<<b<<" = "<<hasil;
 return 0;
}

Tidak ada komentar:

Posting Komentar

Translate

Popular Posts

Postingan Populer

Recent Posts