Source Code Pascal Menghitung Pangkat


Dibawah ini adalah source code pascal untuk menghitung pangkat.

{—copy here—}

program Bilangan_pangkat;
uses wincrt;
var
a,b,hasil,i :integer;
begin
ClrScr;
write(‘ Nilai Pokok (a)= ‘);
readln(a);

write(‘ Nilai Pangkat (b)= ‘);
readln(b);

hasil:=1;

for i:=1 to b do
begin
hasil:=hasil*a;
end;

writeln;
writeln(‘ Maka, Hasil kali a sampai b= ‘,a,’ pangkat ‘,b);
write(‘ = ‘);
writeln(hasil);
end.

—Selamat Mencoba—

Iklan

Tinggalkan Balasan

Please log in using one of these methods to post your comment:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s