Professional Documents
Culture Documents
Just Basic Per 4
Just Basic Per 4
f=1 n =5
for i=1 to 10 1 1
f=f*i 2 2
print i,f 3 6
next 4 24
print f 5 120
jawaban : n != 120
1 1
2 2 rem faktorial
5 120 fn=1
7 5040 fn=fn*i
8 40320 next
10 3628800 fr = 1
next next
n =6
r =4
r! =24 [lagi]
[ulang]
function f(n)
rem pemakaian fungsi
f=n^2+n-10
[lagi]
end function
input "x=";x
jawaban :
print "f(";x;")=";f(x)
x=1
print
f(1)=-8
[ulang]
function f(n)
rem pemakaian fungsi
f=sin(n*(22/(7*180)))
[lagi]
end function
input "x=";x
jawab
input "y=";y
x=30
print "f(";x;",";x+2;")=";aa(x,y)
f(30)=0.5001825
print
[ulang]
mau coba lagi?y/n y
input "mau coba lagi?y/n ";lagi$
x=90
if lagi$="y" then goto [lagi]
f(90)=0.9999998
if lagi$<>"n" then print "anda salah
pilih":goto [ulang]
aa=n+m
[lagi]
input "x=";x
print [lagi]
next
rem variabel berindeks
end function
for j=1 to 5
input "x(";j;")=";x(j)
jawaban
next
x=5
for i=1 to 7
faktorial(x)=120
locate 20,i+1: print "x(";i;")=";x(i)
next
mau coba lagi?y/n y
x=6
jaawab
faktorial(x)=720
x(1)=1
x(3)=3 x(2)=2
x(4)=4 x(3)=3
x(5)=5 x(4)=4
input x x(5)=5
[lagi] x(6)=0
r=x/2 x(7)=0
i=int(r)
[ulang]
next next
jawab next
n =4
x(1)=1 x(1)=1
x(2)=2 x(2)=2
x(3)=3 x(3)=3
x(4)=4 x(4)=4