Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program app4;
- Uses Wincrt;
- type
- tab= Array [1..46] Of longint;
- Var
- t:tab;
- n,i: longint;
- Function Suite_Fibanacci (t:tab;i:LongInt):longint;
- Var x:longint;
- Begin
- x := t[i-1]+t[i-2];
- Suite_Fibanacci := x;
- End;
- Begin
- Repeat
- Write ('Saisir le nombre de termes: ');
- Readln (n);
- Until (2<n) And (n<=46);
- t[1]:=1;
- t[2]:=1;
- For i:=3 To n Do
- t[i] := Suite_Fibanacci(t,i);
- for i:=1 to n Do
- writeln ('U',i,' = ',t[i]);
- End.
Advertisement
Add Comment
Please, Sign In to add comment