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
What is sql loader? Explain the files used by sql loader to load file?
What is the purpose of the err object in the vbscript language?
i need to sort the data using qtp script for this how i need to write a qtp script
If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?
What are the different types of operators and their order of precedence?
how to automatically update the sql server2005 database records when insert in vb6?
Explain the tristate constants in vbscript?
why do u choose to go for testing why cant for devoloping
How will you get the largest subscript of an array in vbscript?
What is the use of the recordset object and which statement is used to create such an object?
does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks
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.
How to write VB script for login module?
Mention what is the technology used by vb script?
How are arrays declared in the vbscript language?