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


Please Help Members By Posting Answers For Below Questions

Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.

1975


Out of the different type of operators, which are evaluated first and last in the vbscript language?

770


How will you get a subset of a array in vbscript?

778


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

2048


What is the difference between for loop and while loop?

806


Does VB/Win make standalone .EXE files?

3140


What is the purpose of drive object of scripting.filesystemobject class in vbscript?

800


Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.

1655


Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository

2009


When does ‘on click of button’ event gets triggered in the vbscript language?

777


Differentiate javascript and vbscript?

771


give me any information abou vb script books learn quckly

1865


what is diff between static and dynaic arrys?

1842


How should i Create Email invite with server-side Coding?

1826


Mention characteristics of sub procedures?

813