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

regular expression that will recognize a browser as long as its name property starts with mybrowser

2179


What is purpose of scripting.filesystemobject class in vbscript?

1062


create a form to accept username and password validate the username and password with using message box, display the corresponding user message

2581


In html file what is an ideal position to include vbscript?

1358


Mention what is select case statement?

907


Which operator can be used to change the value of the operand or change the state of the condition?

964


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

949


How to capture a runtime error in vbscript?

1087


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?

941


i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me

2213


Mention how to assign a date value to a variable?

1020


Explain the asc function?

874


Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder

2080


What are string functions in vbscript?

1093


What is select case statement?

991