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 / kanikira
a = cint(Inputbox("Enter a number to check whether it is a
prime number or not"))
count = 0
b = 1
Do while b<=a
if a mod b = 0 then
count = count +1
end if
b=b+1
Loop
If count = 2 Then
msgbox "The number "&a& " is a prime number"
Else
msgbox "The number "&a& " is not a prime number"
End if
| Is This Answer Correct ? | 12 Yes | 6 No |
Post New Answer View All Answers
when we use filter funtiom invb script(QTP)
What purpose does ‘on error resume next’ serves?
Why to use option explicit in vb script?
What is the difference between javascript and vbscript?
HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.
How can constants be declared in the vbscript language?
How to take whole text output from screen of Bitmap Application.
A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.
what is the standards used for writing the script in QTP
I need to get some data from data base and store this
(retrieved) data in a excel sheet using VB script in QTP9.0
I have created connection for data base
I have created as excels sheet by using
Set XL=CreateObject("Excel.Application")
XLworksheet.cells(1,1).value= rs.fields.item("<
Explain vbscript in detail?
What is the use of the instr function?
How to open browser in vb script?
Write a test case using Test if the images,a particular test exists,check if the page links match,page response is within a certain range,parameterization of the test,the test should comprise of actions,the test should use a custom function,the test should use global repository
Differentiate javascript and vbscript?