Search here for all the info you want in this Blog

write a program to print first 50 prime numbers

write a program to print first 50 prime numbers




n=50
i=1
m=2
DoWhile(i<=n)
prime = true
For j=2To m Step1
If ((m mod j) = 0and (j<>m)) then
prime=false
Exitfor
Endif
Next
If prime = TrueThen
wscript.echo(m)
i=i+1
Endif
m=m+1
Loop

2 comments: