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 the technology used by vb script?
HOw we can apply web service checkpoint in QTP 9.5? I tried it out with net connection also. But not getting success.
What methods are used to create text files and open text files in the vbscript language?
I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?
Explain about scrrun.dll?
how does vb script help in web page designing? explain with example.
How will you convert a string to lower case string using vbscript?
how to automatically update the sql server2005 database records when insert in vb6?
How to scroll down a page while recording in qtp. suggest me any method apart from low level recording.
how to write a vb script in QTP for yahoo registration form, i want to check the performance also like performance test, stress, load test like that.
hi all, i had a question, that how to find out hiding a coloumn in a table i had a table having the following column names NAME DESCRIPTION CREATED TIME CREATED USER if i right clicked on a NAME column it will displays a menu having the same column names in a list like NAME DESCRIPTION CREATED TIME CREATED USER with check boxes.if i unched any check box, that column name should not be appear in the main table column names could anyone please solve this problem?
How will you compare two strings in vbscript?
Can someone please tell me what poor design in a relational database (not the layout or style) is and how it can be avoided? PLEASE...im desperate.
What is the difference between VBScript and JavaScript?
Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.