Saturday, 21 March 2015


'Find the Prime number before the given number  

INum = cint(inputbox("Enter The Number"))
For i=2 to INum
     count = 0
     j = 1
       Do while j<=i
       if i mod j = 0 Then
       count = count +1
        End If
        j=j+1
        Loop
    If count = 2 Then
    temp = temp&" "&i
    End if

  
Next
msgbox temp 

No comments:

Post a Comment