-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquest.fprg
46 lines (46 loc) · 2.29 KB
/
quest.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
<?xml version="1.0"?>
<flowgorithm fileversion="2.11">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="Admin"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2022-01-17 05:33:41 PM"/>
<attribute name="created" value="QWRtaW47UEVBQ0g7MjAyMi0wMS0xNzswMzo0ODo1MyBQTTsyMTI0"/>
<attribute name="edited" value="QWRtaW47UEVBQ0g7MjAyMi0wMS0xNzswNTozMzo0MSBQTTszOzIyMjc="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="i, n, m" type="Integer" array="False" size=""/>
<output expression=""Enter the size of the array."" newline="True"/>
<input variable="n"/>
<assign variable="m" expression="n"/>
<declare name="a" type="Integer" array="True" size="n"/>
<declare name="b" type="Integer" array="True" size="m"/>
<output expression=""Enter the values of the elements of the array."" newline="True"/>
<for variable="i" start="0" end="n-1" direction="inc" step="1">
<input variable="a[i]"/>
</for>
<output expression=""On squaring the elements of array A to obtain array B:"" newline="True"/>
<for variable="i" start="0" end="n-1" direction="inc" step="1">
<assign variable="b[i]" expression="a[i]*a[i]"/>
<output expression="b[i]" newline="True"/>
</for>
<output expression=""On replacing even squares with zero and displaying array B:"" newline="True"/>
<for variable="i" start="0" end="m-1" direction="inc" step="1">
<if expression="b[i]%2=0">
<then>
<output expression="0" newline="True"/>
</then>
<else>
<output expression="b[i]" newline="True"/>
</else>
</if>
</for>
<output expression=""Displaying Array A:"" newline="True"/>
<for variable="i" start="0" end="n-1" direction="inc" step="1">
<output expression="a[i]" newline="True"/>
</for>
</body>
</function>
</flowgorithm>