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...

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 / lak

n=inputbox("Enter a Number to check whether the given
number is prime or not")

flag=1

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

if flag=1 then
msgbox "Prime"
else
msgbox "not prime"
end if

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to declare an array in vbscript?

1339


what is the features of visual basic?

2156


Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?

1016


What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?

1027


Mention what is the technology used by vb script?

984


How will you release the memory acquired by an array variable in vbscript?

1235


how to comvert 120 into one hunderd twenty rupees only and vice varsa

2375


Mention what are the rules to name variable in vbscript?

1033


Write program for identifyig duplicates in flight Departing from and Arriving in mercury tours(web application).

1923


How to open a file. What is the perpose of true and false mode there?

1122


What are the advantages of vbscript?

1093


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

2134


if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.

1840


Which loop is used in case of arrays in the vbscript language?

968


why do u choose to go for testing why cant for devoloping

2076