You are on page 1of 2

Flowchart:

t

y

y



t


























start
n1=0,n2=1,t=0
;4*a*c
x==1
x==0
for (i=3;i<=x;i++)
t=0;
t=t+(n1+n2);
n1=n2;
n2=t;
print n1
print t
stop
Input x

Pseudocode:
Deklarasi
x ,n1,n2,t: int
Proses:
n1=0,n2=1,t=0;
input x
if (x==1)
print n1;
else if(x==0)
printf \n;
else
printf n1,n2;
for (i=3;i<=x;i++)
t=0;
t=t+(n1+n2);
n1=n2;
n2=t;
print t;
end




trace:
Input : x = 6

Proses: D = (5*5) (4*1*6) = 1
x
1
= (- 5 + sqrt (1)) / 2*1 = - 2
x
2
= (- 5 sqrt(1)) / 2*1 = - 3

Output : 0 1 1 2 3 5

You might also like