-
Notifications
You must be signed in to change notification settings - Fork 0
/
frequency array-17.fprg
37 lines (37 loc) · 1.98 KB
/
frequency array-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
<?xml version="1.0"?>
<flowgorithm fileversion="3.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="chennavaram arnav"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2022-12-09 11:23:07 PM"/>
<attribute name="created" value="Y2hlbm5hdmFyYW0gYXJuYXY7QVJOQVZST0ctQ0xTMlFPOzIwMjItMTItMDk7MTA6MjE6MDEgQU07NDA2NQ=="/>
<attribute name="edited" value="Y2hlbm5hdmFyYW0gYXJuYXY7QVJOQVZST0ctQ0xTMlFPOzIwMjItMTItMDk7MTA6MzU6MTIgQU07MTs0MTgw"/>
<attribute name="edited" value="SFA7REVTS1RPUC1MM1JERUtGOzIwMjItMTItMDk7MTE6MjU6MDQgQU07NzsyNjAw"/>
<attribute name="edited" value="SkVFU0hJVEhBO0RFU0tUT1AtSTQzVlROVjsyMDIyLTEyLTA5OzExOjIzOjA3IFBNOzE7MzEzOA=="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="array" type="Integer" array="True" size="10"/>
<declare name="input, freq, x, value" type="Integer" array="False" size=""/>
<for variable="x" start="0" end="9" direction="inc" step="1">
<output expression=""Enter "&x+1&" value"" newline="True"/>
<input variable="input"/>
<assign variable="array[x]" expression="input"/>
</for>
<output expression=""Enter the value for which the frequency should be found"" newline="True"/>
<input variable="value"/>
<assign variable="freq" expression="0"/>
<for variable="x" start="0" end="9" direction="inc" step="1">
<if expression="array[x]=value">
<then>
<assign variable="freq" expression="freq+1"/>
</then>
<else/>
</if>
</for>
<output expression=""The frequency of the given value in array is "&freq" newline="True"/>
</body>
</function>
</flowgorithm>