-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrequncy_in_an_array ...fprg
41 lines (41 loc) · 2.22 KB
/
frequncy_in_an_array ...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
<?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 10:28:08 PM"/>
<attribute name="created" value="Y2hlbm5hdmFyYW0gYXJuYXY7QVJOQVZST0ctQ0xTMlFPOzIwMjItMTItMDk7MTA6MjE6MDEgQU07NDA2NQ=="/>
<attribute name="edited" value="Y2hlbm5hdmFyYW0gYXJuYXY7QVJOQVZST0ctQ0xTMlFPOzIwMjItMTItMDk7MTA6MzU6MTIgQU07MTs0MTgw"/>
<attribute name="edited" value="SFA7REVTS1RPUC1MM1JERUtGOzIwMjItMTItMDk7MTE6MjU6MDQgQU07NzsyNjAw"/>
<attribute name="edited" value="diBqIHNyaWthcjtERVNLVE9QLUpMOTVCVVU7MjAyMi0xMi0wOTsxMDoyODowOCBQTTsxMTszNDU3"/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<comment text="declare array[10]"/>
<declare name="array" type="Integer" array="True" size="10"/>
<comment text="declare input and frequency and x and value"/>
<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>
<comment text="print enter the value for the ffrequency should be found"/>
<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>
<comment text=""/>
<output expression=""The frequency of the given value in array is "&freq" newline="True"/>
</body>
</function>
</flowgorithm>