Now you can Subscribe using RSS

Submit your Email

Jumat, 25 Maret 2016

#Kasus 4.7

Unknown



#include <iostream>
#include <string>
using namespace std; 
int main(int argc, char** argv) {
float hasil;
int i;
float x;
int y;
hasil = 1;
cout << "Masukkan angka yang ingin dipangkatkan = ";
cin >> x;
cout << "Masukkan pangkat = ";
cin >> y;
cout << endl;
if (y>=0){
    i =1;
    while (!(i>y)){
        hasil =hasil*x;
        i =i+1;
    }
}
else{
    i =0;
    while (!(i<=y)){
    hasil =hasil*(1/x);
        i =i-1;
    }
}
cout << "=> " << x << " pangkat " << y << " adalah " << hasil << endl;
return 0;
}
Program raptornya

Unknown / Author & Editor

Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.

0 komentar:

Posting Komentar

Coprights @ 2016, Blogger Templates Designed By Templateism | Distributed By Rika Nursita