Could Anybody tell me VBScript for
Check if a given number is Prime number-Don't use any Built-
in Functions Boolean/int is Prime(int number).. Thanks in
advance.
Answer Posted / pankaja yathindrakumar
' Script to find if the given number is Prime or Not
Function Prime(n)
If n<=1 Then
Exit Function
Else
Flag="Prime"
For i=2 To n-1
If n Mod i=0 Then
Flag ="Not Prime"
End If
Next
End if
Prime=Flag
End Function
Res=Prime(6)
MsgBox Res
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is byref and byval parameters in vbscript?
What is sql loader? Explain the files used by sql loader to load file?
Mention characteristics of sub procedures?
How to take whole text output from screen of Bitmap Application.
How do i automate a website www.flyashx.com without having any test cases witin a week time.
Explain the functionality of vbscript?
what types of bugs will we find out in banking projects for automation testing?
How will you get a subset of a array in vbscript?
What's the difference between vbscript and vb.net?
Which operator is used to perform the comparison among 2 operands in the vbscript language?
What are the naming conventions while declaring a variable in the vbscript language?
How to create a cookie using vbscript?
I want to run QTP script on Linux server is it possible to do this by connecting Windows to Linux through VPN/Terminal Server and just run the script on Linux server.
how to write validation function for date in vb script
Explain about scrrun.dll in vbscript?