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

how to write a vb script in QTP for yahoo registration form, i want to check the performance also like performance test, stress, load test like that.

5264


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

995


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

1767


What is variant in vb script?

1202


how to check whether link is disabled in QTP??

6159


how to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me

14343


What is dictionary object in vbscript? Explain?

1218


How will you get the smallest subscript of an array in vbscript?

1422


When are redim statement and preserve keyword used in the vbscript language?

1081


Why to use option explicit in vb script?

1099


Mention how you can call vbscript functions?

1186


Mention how to create a cookie using vbscript?

1067


Can someone please tell me what poor design in a relational database (not the layout or style) is and how it can be avoided? PLEASE...im desperate.

1915


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

1198


Can automation testing find ssame no. of bugs what we can find by manual testing?

2024