Rabu, 06 April 2016

Kasus 5.3 ALPRO (ALGORITMA DAN PEMROGRAMAN)


Dengan menggunakan fuhttps://draft.blogger.com/blogger.g?blogID=7494826082440134626#editor/target=post;postID=7678934488772070052ngsi ln dan exp, buatlah fungsi untuk menghasilkan nilai xy
Dengan Dev C++ dan Raptor :
 
sourde code :
#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;  
}
 Hasil Compilernya
 FLOWCHART
 

Tidak ada komentar:

Posting Komentar