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
1. How do declare public variable in vb scripts?
i need to sort the data using qtp script for this how i need to write a qtp script
How will you check that a variable is an array in vbscript?
Mention when to use function procedures and what are its characteristics?
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.
What is the use of the recordset object and which statement is used to create such an object?
Which command is used for writing text on a page?
What is the purpose of drive object of scripting.filesystemobject class in vbscript?
How strcomp function works?
Which operator can be used to change the value of the operand or change the state of the condition?
what is event handling?
What are subprocedures in vbscript?
Which event is triggered when mouse focus comes out of an element in the vbscript language?
What is vbscript language used for and which earlier language is it modeled upon?
How many types of procedures are available in the vbscript language?