program faktor_pascal;
uses wincrt;
function faktorial (a:integer):longint;
begin
if(A=1)then
faktorial:=1
else
faktorial:=a*faktorial(a-1);
end;
var x:integer;
begin
clrscr;
writeln('faktorial sequence');
writeln;
write('berapa faktorial : ');readln(x);
writeln(x,'faktorial ','+',faktorial(x));
writeln;
write('tekan sembarang tombol untuk keluar...');
readln;
end.
Minggu, 09 Februari 2014
PROGRAM FAKTORIAL
Diposting oleh Fitri Pramushintha di 23.13PROGRAM FUNGSI KUADRAT
Diposting oleh Fitri Pramushintha di 23.11
uses wincrt;
var x,y,z,s:integer;
function fungsi(a,b,c,x:integer):integer;
begin
fungsi:=a*(x*x)-b*x+c;
end;
begin
write('masukan a:');readln(x);
write('masukan b:');readln(y);
write('masukan c:');readln(z);
write('masukan x:');readln(s);
writeln('f(x)=',x,'(x^',x,'2)-',y,'x+',z);
writeln('f(',s,')=',fungsi(x,y,z,s));
readln;
end.
Subscribe to:
Komentar (Atom)





