11-11-2009, 04:58 PM
VB script to check a number is prime or not
|
VB Script
|
|
11-11-2009, 04:58 PM
VB script to check a number is prime or not
11-11-2009, 05:13 PM
Code: For x = 3 To 200 Step 2
bIsPrime = True
For y = 2 To x\2
bIsPrime = x mod y > 0
If Not bIsPrime Then Exit For
Next
' check if the bIsPrime returns true if yes then it is prime.
If bIsPrime Then
document.writeln("Found a prime number: " & x)
End If
Nextby the way did you google it? |
|
« Next Oldest | Next Newest »
|