program perpangkatan;
uses wincrt;
var i,o,p:longint;
hasil:real;
begin writeln('a pangkat b');
writeln('masukkan a=');readln(o);
writeln('masukkan b=');readln(p);
hasil:=1;
for i:=1 to abs(p) do
hasil:=o * hasil;
if (p<0) then
begin
write('hasil=');
write(1/hasil);
end
else
begin
write('hasil= ');
write(hasil);
end;
end.
uses wincrt;
var i,o,p:longint;
hasil:real;
begin writeln('a pangkat b');
writeln('masukkan a=');readln(o);
writeln('masukkan b=');readln(p);
hasil:=1;
for i:=1 to abs(p) do
hasil:=o * hasil;
if (p<0) then
begin
write('hasil=');
write(1/hasil);
end
else
begin
write('hasil= ');
write(hasil);
end;
end.
Posting Komentar