Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

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.

1948


Could Anybody Please tell me What is the script for Find 3rd Largest element in the Array without using a SORT function int Find(int arr[], int size); Thanks in Advance..

2398


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.

2231


Explain about the support of asp for vb script functionality?

887


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

2058


How will you format a number in percetage format in vbscript?

929


What is the use of option explicit in vbscript?

948


Dear All, I am geting below IE error whilie executing the QTP scripts in Batch mode "Internet Explorer has encountered a problem and needs to close. We are sorry for the inconvenience." can any one suggest me how to resolve this issue . Thanks Balaji

1667


how to answer "TELL ME ABOUT UR SELF" as exp.person. whr to start and whr to stop. can anyone tel me

1794


How can you create a file object to work with the files in the vbscript language?

902


Hi Friends Rajendra this is bhavani prasad, iam working Hyderabad. i faced one problem with qtp recording mode i.e in my application there is 100 records first we click the first record that record will be jumped to next session and 99 records will there stop the recording and run the same script .Run this script qtp does not identify the records. So plz tell me what is the solution.

2051


Can we create Crystal Report object in QTP?If yes then what it is and what are its various properties?

3408


Mention if qtp generates vbscript code as we record actions, can't it possible to directly write using vbscript code when qtp does the same thing too?

955


Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.

2945


What is event handling in vbscript?

1020