PERKALIAN BERULANG

program perkalian_berulang;

uses wincrt;

var a,b,c:integer;

function faktorial(n:integer):longint;

begin

if n=0 then faktorial:=1

else

faktorial:=n*faktorial(n-1);

end;

begin

write(‘a=’);read(a);

writeln;

for b:=1 to (a-1) do write(b,’*’);

write(a,’=’,faktorial(a));

end.

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

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

Foto Google+

You are commenting using your Google+ 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 )

Connecting to %s

%d blogger menyukai ini: