Skip to content

Instantly share code, notes, and snippets.

@Ansarina
Created October 22, 2015 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ansarina/b182c04c209892c830d8 to your computer and use it in GitHub Desktop.
Save Ansarina/b182c04c209892c830d8 to your computer and use it in GitHub Desktop.
Integer Function Aval(n) !looking for prime number
Integer::n,i, BakhshPazir
BakhshPazir=0
Do i=1, n
If(mod(n,i)==0)then
BakhshPazir= BakhshPazir+1
EndIf
End do
If (BakhshPazir==2) then
Aval=n
Else
Aval=0
EndIf
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment