-
Notifications
You must be signed in to change notification settings - Fork 0
/
fibonacci-17.fprg
46 lines (46 loc) · 2.12 KB
/
fibonacci-17.fprg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0"?>
<flowgorithm fileversion="3.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="hansi"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2023-01-27 09:03:57 PM"/>
<attribute name="created" value="aGFuc2k7SEFOU0lDQTsyMDIzLTAxLTI3OzA3OjA3OjU1IFBNOzIzMTk="/>
<attribute name="edited" value="aGFuc2k7SEFOU0lDQTsyMDIzLTAxLTI3OzA4OjQ1OjU5IFBNOzQ7MjQzNw=="/>
<attribute name="edited" value="SkVFU0hJVEhBO0RFU0tUT1AtSTQzVlROVjsyMDIzLTAxLTI3OzA5OjAzOjU3IFBNOzE7MzE0Nw=="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="fib, n" type="Integer" array="False" size=""/>
<input variable="n"/>
<output expression=""The required fibonacci series is "" newline="True"/>
<assign variable="fib" expression="Fibonacci(n)"/>
</body>
</function>
<function name="Fibonacci" type="Integer" variable="a">
<parameters>
<parameter name="n" type="Integer" array="False"/>
</parameters>
<body>
<declare name="a, b, c, i" type="Integer" array="False" size=""/>
<assign variable="c" expression="1"/>
<assign variable="i" expression="1"/>
<if expression="n=0">
<then/>
<else>
<assign variable="a" expression="0"/>
<assign variable="b" expression="1"/>
<while expression="i<=n">
<assign variable="c" expression="a+b"/>
<output expression="a &" + " &b&" = " &c" newline="True"/>
<assign variable="a" expression="b"/>
<assign variable="b" expression="c"/>
<assign variable="i" expression="i+1"/>
</while>
<output expression=""no value"" newline="True"/>
</else>
</if>
</body>
</function>
</flowgorithm>