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 / anwar basha

n=cint(inputbox("enter the number"))
if n=0 then
msgbox " invalid no"
end if

flag=0
for i=1 to n-1
if n mod i =0 then
falg=1
end if
exit for
next

if falg=1 then
msgbox "not a prime num"
else
msgbox "prime no"
end if

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the arrays in vb script?

1001


Explain the scope of the variables using dim, public, and private keywords respectively.

1099


Which operator can be used to do an xor operation in vbscript?

1180


while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans

2000


Why is the use of exit do or exit for statements within loops discouraged?

980


HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.

2464


How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.

2969


Develop a parameterized action that accomplishes the following a. Launch a browser of users choice ( example : IE, chrome etc) b. Open up a search engine (Google, Bing etc) c. Perform a search d. Click a particular link depending on the user’s choice ( 1st , 2nd or third link)

1801


Explain the operator precedence in vb script?

1012


Mention what are the rules to name variable in vbscript?

961


PLz send me the VB scripts which is having more examples my email id : hareen_11@yahoo.com

2071


What are the disadvantages of vbscript?

1166


Which in-built function related to an array joins substrings into one string in the vbscript language?

905


What is the difference between vbscript and vba?

1059


Which in-built function is used to format the number in the vbscript language?

948