-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharray frequency.fprg
59 lines (59 loc) · 2.88 KB
/
array frequency.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
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="Praneeth Reddy"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2022-01-18 03:40:25 PM"/>
<attribute name="created" value="UHJhbmVldGggUmVkZHk7UFJBTkVFVEgtUEM7MjAyMS0xMi0yNzswMjo0OTozMSBQTTszNDMw"/>
<attribute name="edited" value="UHJhbmVldGggUmVkZHk7UFJBTkVFVEgtUEM7MjAyMi0wMS0wNTswMTozNToyNSBBTTs2OzM1MjA="/>
<attribute name="edited" value="a2FydGg7TEFQVE9QLURQSFZGOEFEOzIwMjItMDEtMTg7MDM6NDA6MjUgUE07NjsyOTk5"/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="n, i, j, c, count" type="Integer" array="False" size=""/>
<output expression=""enter the number of integers"" newline="True"/>
<input variable="n"/>
<declare name="array" type="Integer" array="True" size="n"/>
<output expression=""enter the numbers"" newline="True"/>
<for variable="i" start="0" end="n-1" direction="inc" step="1">
<input variable="array[i]"/>
</for>
<assign variable="c" expression="0"/>
<for variable="i" start="0" end="n-1" direction="inc" step="1">
<for variable="j" start="i+1" end="n-1" direction="inc" step="1">
<if expression="array[i]>array[j]">
<then>
<assign variable="c" expression="array[i]"/>
<assign variable="array[i]" expression="array[j]"/>
<assign variable="array[j]" expression="c"/>
</then>
<else/>
</if>
</for>
</for>
<for variable="i" start="0" end="n-1" direction="inc" step="1">
<output expression="array[i]" newline="True"/>
</for>
<for variable="i" start="0" end="n-1" direction="inc" step="1">
<assign variable="count" expression="1"/>
<for variable="j" start="i+1" end="n-1" direction="inc" step="1">
<if expression="array[i]=array[j]">
<then>
<assign variable="count" expression="count+1"/>
</then>
<else/>
</if>
</for>
<if expression="count=0">
<then/>
<else>
<output expression=""the count of "&array[i]&" is "&count" newline="True"/>
</else>
</if>
<assign variable="i" expression="i+count-1"/>
</for>
</body>
</function>
</flowgorithm>