write a program to print first 50 prime numbers
n=50
i=1
m=2
Do While(i<=n)
prime = true
For j=2 To m Step 1
If ((m mod j) = 0 and (j<>m)) then
prime=false
Exit for
End if
Next
If prime = True Then
wscript.echo(m)
i=i+1
End if
m=m+1
Loop
n=50
i=1
m=2
Do While(i<=n)
prime = true
For j=2 To m Step 1
If ((m mod j) = 0 and (j<>m)) then
prime=false
Exit for
End if
Next
If prime = True Then
wscript.echo(m)
i=i+1
End if
m=m+1
Loop
This comment has been removed by the author.
ReplyDeleteA good site for beginners.
ReplyDelete