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 / venkat ramana reddy

f=0
msgbox "Enter number"
a=inputbox("enter a no")
For i=1 to a
reminder=a mod i
If reminder=0 Then
f=f+1
End If
Next
If f=2 Then
msgbox "the entered number is prime:"&a
else
msgbox "the entered no.is not prime:"&a
End If

Is This Answer Correct ?    19 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1. How do declare public variable in vb scripts?

2195


i need to sort the data using qtp script for this how i need to write a qtp script

3731


How will you check that a variable is an array in vbscript?

1052


Mention when to use function procedures and what are its characteristics?

1197


Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.

3058


What is the use of the recordset object and which statement is used to create such an object?

1007


Which command is used for writing text on a page?

1058


What is the purpose of drive object of scripting.filesystemobject class in vbscript?

1043


How strcomp function works?

1144


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

1079


what is event handling?

1055


What are subprocedures in vbscript?

1144


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

999


What is vbscript language used for and which earlier language is it modeled upon?

1058


How many types of procedures are available in the vbscript language?

1046