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
Explain what is loose binding? Why is it not a good practice to use it?
How will you compare two strings in vbscript?
how to increasing the numbers in a given text box please write a vb script
What are subprocedures in vbscript?
If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?
Explain about operator precedence in vb script?
how to acces the remote mechine using vb cript(QTP)
How to throw an error in vbscript?
Explain How do you create a recordset object in vbscript?
Which operator can be used to change the value of the operand or change the state of the condition?
i need to sort the data using qtp script for this how i need to write a qtp script
What are the disadvantages of vbscript?
How to add actions in driver script to run those actions in QTP?
What is purpose of scripting.filesystemobject class in vbscript?
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