-
Notifications
You must be signed in to change notification settings - Fork 0
/
largest integer in an array(9.12.22).fprg
38 lines (38 loc) · 1.98 KB
/
largest integer in an array(9.12.22).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
<?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:22:21 AM"/>
<attribute name="created" value="Y2hlbm5hdmFyYW0gYXJuYXY7QVJOQVZST0ctQ0xTMlFPOzIwMjItMTItMDk7MTA6MjE6MDEgQU07NDA2NQ=="/>
<attribute name="edited" value="Y2hlbm5hdmFyYW0gYXJuYXY7QVJOQVZST0ctQ0xTMlFPOzIwMjItMTItMDk7MTA6MzU6MTIgQU07MTs0MTgw"/>
<attribute name="edited" value="TG9nZXNoO0RFU0tUT1AtRkJCOU5JNTsyMDIyLTEyLTA5OzExOjIyOjIxIEFNOzE7MzAyMA=="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<comment text="declare array and array size"/>
<declare name="array" type="Integer" array="True" size="5"/>
<declare name="input, max, x" type="Integer" array="False" size=""/>
<comment text="enter the start and end to use for loop"/>
<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>
<assign variable="max" expression="array[0]"/>
<comment text="enter the start and end to use for loop"/>
<for variable="x" start="0" end="4" direction="inc" step="1">
<if expression="array[x]>max">
<then>
<assign variable="max" expression="array[x]"/>
</then>
<else/>
</if>
</for>
<comment text="this is used to print largest value in array"/>
<output expression=""The largest integer value in array is "&max" newline="True"/>
</body>
</function>
</flowgorithm>