-
Notifications
You must be signed in to change notification settings - Fork 0
/
Largest_integer_in_a_array.fprg
42 lines (42 loc) · 2.32 KB
/
Largest_integer_in_a_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
42
<?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 08:16:26 PM"/>
<attribute name="created" value="Y2hlbm5hdmFyYW0gYXJuYXY7QVJOQVZST0ctQ0xTMlFPOzIwMjItMTItMDk7MTA6MjE6MDEgQU07NDA2NQ=="/>
<attribute name="edited" value="Y2hlbm5hdmFyYW0gYXJuYXY7QVJOQVZST0ctQ0xTMlFPOzIwMjItMTItMDk7MTA6MzU6MTIgQU07MTs0MTgw"/>
<attribute name="edited" value="SFA7REVTS1RPUC1MM1JERUtGOzIwMjItMTItMDk7MTA6NTc6MTQgQU07MjsyNjAw"/>
<attribute name="edited" value="dmlzaGE7VklTSEFMOzIwMjItMTItMDk7MDg6MTY6MjYgUE07MTsyMzg3"/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<comment text="Declaring array"/>
<declare name="array" type="Integer" array="True" size="5"/>
<comment text="Declaring other variables"/>
<declare name="input, max, x" type="Integer" array="False" size=""/>
<comment text="Getting the values and assigning them in the array"/>
<for variable="x" start="0" end="4" direction="inc" step="1">
<output expression=""Enter "&x+1&" value"" newline="True"/>
<input variable="input"/>
<assign variable="array[x]" expression="input"/>
</for>
<comment text="assigning the the max value as the first value"/>
<assign variable="max" expression="array[0]"/>
<comment text="checking the remaing values to see if they are greater than the first value"/>
<for variable="x" start="0" end="4" direction="inc" step="1">
<if expression="array[x]>max">
<then>
<comment text="updating the max value to the largest value found "/>
<assign variable="max" expression="array[x]"/>
</then>
<else/>
</if>
</for>
<comment text="outputing the largest value"/>
<output expression=""The largest integer value in array is "&max" newline="True"/>
</body>
</function>
</flowgorithm>