Tugas Alpro PPT Minggu ke 5 Kasus 5.3


Fungsi menentukan nilai x pangkat y


Logikanya Menggunakan Raptor



Program C++



#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 Di Pangkat Berapa :";cin>>b;
    hasil=pangkat(a,b);
    cout<<a<<"Pangkat"<<b<<"="<<hasil;
    return 0;
}




Share this:

ABOUT THE AUTHOR

Ceyron Louis

A web designer from India. And then you write some more information about yourself like this to fill out the space that is left.

0 komentar:

Posting Komentar