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

Dim i,num
num=CInt(InputBox("Enter the numbers to limit the
Prime:"))
i = 3
While i <= num
bIsPrime = True
j = 2
While j <= i\2 And bIsPrime
bIsPrime = i Mod j > 0
j = j + 1
Wend
If bIsPrime Then
Wscript.echo("Found a prime number: " & i)
End If
i = i + 2
Wend

Is This Answer Correct ?    0 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1029


write a function to read the items from combobox of Flight reservation & save in excel (QTP)??

2850


Why is error handling required?

1018


Mention what is vbscript procedures?

1000


Hi All, I am facing one problem in QTP. There is link object in my application that exist in the Frame in mozilla firefox. Click event on that object is not working but once the frame is enabled/activated then click event works fine.But the frame does not have the activate property. This problem is coming in firefox only. Regards

2702


How to open browser in vb script?

1235


How to write functions and sub in vb script?

1099


How should i Create Email invite with server-side Coding?

2132


What are the different types of operators and their order of precedence?

1041


why variable name should not exceed 255 characters?

2225


What is variant in vb script?

1151


How to Import data from a file (file is on the desktop) to the data table

1999


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

1372


Mention the environments where vbscript could be run?

1217


What are the uses of vb script?

1034