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
Which operator can be used to change the value of the operand or change the state of the condition?
write a function to read the items from combobox of Flight reservation & save in excel (QTP)??
Why is error handling required?
Mention what is vbscript procedures?
Hi All, I am facing one problem in QTP. There is link object in my application that exist in the Frame in mozilla firefox. Click event on that object is not working but once the frame is enabled/activated then click event works fine.But the frame does not have the activate property. This problem is coming in firefox only. Regards
How to open browser in vb script?
How to write functions and sub in vb script?
How should i Create Email invite with server-side Coding?
What are the different types of operators and their order of precedence?
why variable name should not exceed 255 characters?
What is variant in vb script?
How to Import data from a file (file is on the desktop) to the data table
How will you get the smallest subscript of an array in vbscript?
Mention the environments where vbscript could be run?
What are the uses of vb script?