Pseudo Code Kalkulator Pangkat - Kombinasi
Tugas Program Komputer
Kalkulator
Pangkat dan Kombinasi
Nama : Lucy Dewan Yuliyanto
NIM : 110074
Kelas : A 2011
1. Algorithms Calculating_Exponent (ab=c)
DECLARATION
a,
b, c : real;
DESCRIPTION
Read
(a,b)
c:=exp
(b*ln(a));
Write
(c);
2. Algorithms
Calculating_Combination (C(n,k)=
)
DECLARATION
n,
k, g, p, q, r : Integer;
c :
Real;
DESCRIPTION
read(n,k)
if n < k then c = 0
write (c);
p ← 1;
for i ← 1 to n do
p ← (p*i)
q ← 1;
for i ← 1 to k do
q ← (q*i)
r ← 1;
g ← (n-k);
for i ← 1 to g do
r ← (r*i);
c ← (p/(q*r));
write(c);
end;
end.
Komentar
Posting Komentar