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 / naga siva sankar
val=Inputbox("enter any number")valprime=0
For i=2 to Int(val/2)
If (val mod i)=0 Then
msgbox "not a prime number"
valprime=1
Exit for
End If
Next
If valprime=0 Then
msgbox "prime number"
End If
Is This Answer Correct ? | 37 Yes | 15 No |
Post New Answer View All Answers
What is byref and byval parameters in vbscript?
How can constants be declared in the vbscript language?
How you can call vbscript functions?
How to Convert Hex color code to color name in VB Script?
does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks
What is the difference between function and procedure?
what is used of Property........End Property loop ? how to write the script for it?
What is the event handling in vbscript?
Like OPTION EXPLICIT statement what are the other statements used in vbscript and their usage. Please post me all the statements please.
Hellow friends, I am learning QTP,but here problem is VB script. please guide me how to learn VB script w.r.t QTP and if you know any books tell me or if you have any materials or any use full material or any else w.r.t QTP please post me p.p.sekhar
How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.
Mention the environments where vbscript could be run?
Dear All, I am geting below IE error whilie executing the QTP scripts in Batch mode "Internet Explorer has encountered a problem and needs to close. We are sorry for the inconvenience." can any one suggest me how to resolve this issue . Thanks Balaji
Explain the constants in vbscript?
When does ‘on click of button’ event gets triggered in the vbscript language?