How to find the prime number?

n=2
flag=0
For i=2 to (n-1)
    If (n mod i)=0 Then
          flag=flag+1
    Exit for
    End If
Next
If flag=1 Then
          print " The given number is not prime"
Else
          print "The given number is prime"
End If


           

Comments

Popular posts from this blog

Waterfall Model in STLC

Latest Version of TestComplete

Successful tester