Repository navigation
Expand file tree
/
Copy pathq8.fprg
More file actions
43 lines (43 loc) · 1.83 KB
/
Copy pathq8.fprg
File metadata and controls
43 lines (43 loc) · 1.83 KB
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
<?xml version="1.0"?>
<flowgorithm fileversion="4.2">
<attributes>
<attribute name="name" value="q8"/>
<attribute name="authors" value="Divyam"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2025-08-19 06:36:08 PM"/>
<attribute name="created" value="RGl2eWFtO0xBUFRPUC1LVTdINE1ESTsyMDI1LTA4LTE5OzA2OjE5OjAyIFBNOzI5NzM="/>
<attribute name="edited" value="RGl2eWFtO0xBUFRPUC1LVTdINE1ESTsyMDI1LTA4LTE5OzA2OjM2OjA4IFBNOzE7MzA4Ng=="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="num, i, flag" type="Integer" array="False" size=""/>
<assign variable="flag" expression="0"/>
<output expression=""enter the number"" newline="True"/>
<input variable="num"/>
<if expression="num=2">
<then>
<output expression=""it is a prime"" newline="True"/>
</then>
<else>
<for variable="i" start="2" end="num-1" direction="inc" step="1">
<if expression="num%i=0">
<then>
<assign variable="flag" expression="1"/>
</then>
<else/>
</if>
</for>
<if expression="flag=1">
<then>
<output expression=""not prime"" newline="True"/>
</then>
<else>
<output expression=""prime"" newline="True"/>
</else>
</if>
</else>
</if>
</body>
</function>
</flowgorithm>