Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Pangkat

By: mirfanfi on Oct 6th, 2012  |  syntax: Pascal  |  size: 0.54 KB  |  views: 34  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. program bilangan_pangkat;
  2. uses crt;
  3. var
  4. a,b : integer;
  5. hasil : real;
  6. YN : char;
  7. function pangkat(x:integer):real;
  8. begin
  9. hasil := exp(x*ln(a));
  10. pangkat := hasil;
  11. end;
  12. label batas;
  13. begin
  14. batas:
  15. clrscr;
  16. writeln('==========================');
  17. writeln('|      MARI BERHITUNG    |');
  18. writeln('==========================');
  19. write('Masukkan Mau dipangkatkan berapa ?');
  20. for a := 1 to 10 do
  21. writeln('hasil dari ',a, '^',b, '=',pangkat(b):2:0);
  22. write('MAU COBA LAGI Y/N ? ');readln(Y/N);
  23. if upcase (YN) = 'Y' then
  24. goto batas;
  25. readln;
  26. end.