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

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

1067


How will you compare two strings in vbscript?

1056


how to increasing the numbers in a given text box please write a vb script

2198


What are subprocedures in vbscript?

1096


If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?

980


Explain about operator precedence in vb script?

1054


how to acces the remote mechine using vb cript(QTP)

2019


How to throw an error in vbscript?

1130


Explain How do you create a recordset object in vbscript?

1009


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

1025


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

3656


What are the disadvantages of vbscript?

1237


How to add actions in driver script to run those actions in QTP?

1934


What is purpose of scripting.filesystemobject class in vbscript?

1110


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

2697