Hi, Anybody could you Please tell me How to write the
script for Checking whether given number is Prime Number or
not..Thanks in Advance
Answer Posted / nisar
Dim i,num
num=CInt(InputBox("Enter the numbers to limit the
Prime:"))
i = 3
While i <= num
bIsPrime = True
j = 2
While j <= i\2 And bIsPrime
bIsPrime = i Mod j > 0
j = j + 1
Wend
If bIsPrime Then
Wscript.echo("Found a prime number: " & i)
End If
i = i + 2
Wend
Is This Answer Correct ? | 0 Yes | 7 No |
Post New Answer View All Answers
wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......
Explain about the extension .hta?
What are the special sub-types in vbscript?
create a form to accept username and password validate the username and password with using message box, display the corresponding user message
What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?
Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?
Which operator is used to perform the comparison among 2 operands in the vbscript language?
What are the uses of vb script?
Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?
Which event is triggered when mouse focus comes out of an element in the vbscript language?
Differentiate javascript and vbscript?
In html file what is an ideal position to include vbscript?
Mention how to assign a date value to a variable?
What is loose binding? Why is it not a good practice to use it?
how to check whether link is disabled in QTP??