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 / pankaj jaju
Function IsPrime(Num)
Dim varNum, varCtr, varLimit
varLimit = Round(Num/2)
For varCtr = 2 To varLimit
varNum = Num Mod varCtr
If varNum = 0 Then
IsPrime = False
Exit For
End If
Next
If varCtr >= varLimit Then
IsPrime = True
End If
End Function
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Mention what is byref and byval parameters in vbscript?
How to pass argument by reference to a function in vbscript?
1. How do declare public variable in vb scripts?
Which object provide information about a single runtime error in a vbscript?
Explain the adodb.stream class?
Explain about constants in vb script?
i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me
how to increasing the numbers in a given text box please write a vb script
How many types of operators are available in the vbscript language?
hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?
Mention what if you do not specify anything when you call a procedure?
How can you fetch the value of a cookie?
Explain a few date functions in vbscript
There are 5 web pages.write a script to click the button on 4th web page.
Which function is used to perform string comparison?