-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathisPrime.ppp
More file actions
34 lines (31 loc) · 737 Bytes
/
isPrime.ppp
File metadata and controls
34 lines (31 loc) · 737 Bytes
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
" ----------------------------------------------------"
"| |"
"| Este programa determina si el número entrado |"
"| es o no un número primo |"
"| |"
" ----------------------------------------------------"
"\nIngrese un número:"
n<<n
bloque_si (n > 0)
i = 2;
ifloat = 2.0;
flag = 0;
ciclo_mientras (i <= n/2)
resto= n/ifloat - n/i;
if (resto == 0.0)
flag = 1;
i = n;
end
i += 1;
ifloat += 1.0;
end
bloque_si (flag == 1)
n + " no es primo."
end
bloque_si (flag == 0)
n + " es primo."
end
end
bloque_si (n <= 0)
"El número ingresado debe ser positivo y mayor a 0."
end