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 / vinay vuppala

1st method


dim a
dim b
b=1
count=0
a=inputbox("enter a number")
for b=1 to a
if((a mod b)=0) then
count=count+1

end if
next
if count>2 then
msgbox("the number "& a &" is a not prime number")
else
msgbox("the number "& a &" is a prime")
end if

Is This Answer Correct ?    17 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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.

2135


What purpose does ‘on error resume next’ serves?

1145


Mention what is vbscript procedures?

1056


Which event is triggered when mouse focus comes out of an element in the vbscript language?

1001


Explain a few date functions in vbscript

1029


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

2404


does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks

2994


Mention the rules for using option explicit statement?

1064


In what way program "hello world" you can write in vbscript?

1166


What is the purpose of on error resume next statement?

1039


What is the use of the instr function?

1102


Like OPTION EXPLICIT statement what are the other statements used in vbscript and their usage. Please post me all the statements please.

2166


How will you get a random number between 0 and 1 in vbscript?

1385


What is loose binding? Why is it not a good practice to use it?

1155


Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?

1371