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
Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?
How do i automate a website www.flyashx.com without having any test cases witin a week time.
What is the purpose of drive object of scripting.filesystemobject class in vbscript?
Which operator can be used to change the value of the operand or change the state of the condition?
What is the difference between a dictionary and an array?
What is the difference between function and procedure?
Explain the asc function?
how to operate webobjects in a webpage using getobject function and then using generic methods?
How to assign a date value to a variable?
what is the differance between BYVAL,BYREF?
Mention how to assign a date value to a variable?
What is the purpose of on error resume next statement?
what is the difference between modular and data and keyword driven framework
Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?
1.I want to establish connection with excel and also want to fetch the data using SQL queries. 2.the code should be written in such a way that in future if I want to migrate from excel to MS excess database , then there should be minimal changes.