-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayprogram_to_count_frequency.fprg
More file actions
42 lines (42 loc) · 2.25 KB
/
Copy pathArrayprogram_to_count_frequency.fprg
File metadata and controls
42 lines (42 loc) · 2.25 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
39
40
41
42
<?xml version="1.0"?>
<flowgorithm fileversion="3.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="user"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2022-12-09 10:54:55 AM"/>
<attribute name="created" value="dXNlcjtMQVBUT1AtQlQxOTRWNFA7MjAyMi0xMi0wOTsxMDo1MDo0NiBBTTsyNzQ1"/>
<attribute name="edited" value="dXNlcjtMQVBUT1AtQlQxOTRWNFA7MjAyMi0xMi0wOTsxMDo1MToyOCBBTTsxO2RlZXBhaztERUVQQUtLVU1BUjsyMDIyLTEyLTA5OzA5OjI3OjEzIEFNO2ZyZXF1ZW5jeSBvZiBhIG51bWJlcl85MTEyMDIyLmZwcmc7ODYyNw=="/>
<attribute name="edited" value="dXNlcjtMQVBUT1AtQlQxOTRWNFA7MjAyMi0xMi0wOTsxMDo1NDo1NSBBTTsyOzI4NTg="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<output expression=""Total numbers in array"" newline="True"/>
<declare name="n" type="Integer" array="False" size=""/>
<input variable="n"/>
<declare name="array" type="Integer" array="True" size="n"/>
<output expression=""which number to find frequency for"" newline="True"/>
<declare name="x" type="Integer" array="False" size=""/>
<input variable="x"/>
<declare name="y" type="Integer" array="False" size=""/>
<for variable="y" start="0" end="n-1" direction="inc" step="1">
<output expression=""Enter the number in index "&y&" :"" newline="True"/>
<declare name="z" type="Integer" array="False" size=""/>
<input variable="z"/>
<assign variable="array[y]" expression="z"/>
</for>
<declare name="cnt" type="Integer" array="False" size=""/>
<assign variable="cnt" expression="0"/>
<for variable="y" start="0" end="n-1" direction="inc" step="1">
<if expression="x==array[y]">
<then>
<assign variable="cnt" expression="cnt+1"/>
</then>
<else/>
</if>
</for>
<output expression=""the frequency is"&cnt" newline="True"/>
</body>
</function>
</flowgorithm>