-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlargest element array.fprg
35 lines (35 loc) · 1.69 KB
/
largest element 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
<?xml version="1.0"?>
<flowgorithm fileversion="3.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="anura"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2022-12-09 11:03:22 PM"/>
<attribute name="created" value="YW51cmE7QU5VUkFHUkVERFk7MjAyMi0xMi0wOTsxMDoxNDozNiBBTTsyNjE5"/>
<attribute name="edited" value="YW51cmE7QU5VUkFHUkVERFk7MjAyMi0xMi0wOTsxMDoyNjozNiBBTTsxOzI3MzA="/>
<attribute name="edited" value="SkVFU0hJVEhBO0RFU0tUT1AtSTQzVlROVjsyMDIyLTEyLTA5OzExOjAzOjIyIFBNOzE7MzEzMw=="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="number, i, max" type="Integer" array="False" size=""/>
<output expression=""Enter the number of array"" newline="True"/>
<input variable="number"/>
<declare name="a" type="Integer" array="True" size="number"/>
<output expression=""Enter the integer"" newline="True"/>
<for variable="i" start="0" end="number-1" direction="inc" step="1">
<input variable="a[i]"/>
</for>
<assign variable="max" expression="a[0]"/>
<for variable="i" start="1" end="number-1" direction="inc" step="1">
<if expression="max<a[i]">
<then>
<assign variable="max" expression="a[i]"/>
</then>
<else/>
</if>
</for>
<output expression=""The greatest element is" &max" newline="True"/>
</body>
</function>
</flowgorithm>