Numero primo
public text v1 · immutableSub primo()
Dim n,i As Integer
Dim primo As Boolean
primo = true
n = Val(InputBox("Escriba un numero para comprobar si es primo: "))
for i=2 to n
if n Mod i = 0 and n <> i then
MsgBox(n & " es multiplo de " & i)
primo = false
exit for
end if
next i
if primo then
MsgBox(n & " es un numero primo")
end if
End Sub