-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfactorial-17.fprg
More file actions
38 lines (38 loc) · 1.55 KB
/
factorial-17.fprg
File metadata and controls
38 lines (38 loc) · 1.55 KB
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
<?xml version="1.0"?>
<flowgorithm fileversion="3.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="JEESHITHA"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2023-01-27 07:10:32 PM"/>
<attribute name="created" value="SkVFU0hJVEhBO0RFU0tUT1AtSTQzVlROVjsyMDIzLTAxLTI3OzA3OjA0OjA4IFBNOzMwMzQ="/>
<attribute name="edited" value="SkVFU0hJVEhBO0RFU0tUT1AtSTQzVlROVjsyMDIzLTAxLTI3OzA3OjEwOjMyIFBNOzE7MzEzNg=="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="n, FAC" type="Integer" array="False" size=""/>
<comment text="declared the variables and given input of n "/>
<input variable="n"/>
<comment text="assigned the fuction for factorial"/>
<assign variable="FAC" expression="fac(n)"/>
<output expression="FAC" newline="True"/>
</body>
</function>
<function name="fac" type="Integer" variable="FAC">
<parameters>
<parameter name="N" type="Integer" array="False"/>
</parameters>
<body>
<declare name="fac" type="Integer" array="False" size=""/>
<if expression="N==1">
<then>
<assign variable="FAC" expression="1"/>
</then>
<else>
<assign variable="FAC" expression="fac(N-1)*N"/>
</else>
</if>
</body>
</function>
</flowgorithm>