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
n=inputbox("enter the number")
count=0
for i= 1 to n
if n mod i=o Then
count=count+1
Endif
Next
if count=2 Then
Msgbox "number is prime"
Else
Msgbox "number is not prime"
Endif
Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What are the 2 ways to pass a value to the function?
How to replace junk code recorded by QTP with a mall function.
How should i Create Email invite with server-side Coding?
Explain How do you create a recordset object in vbscript?
Which operator is used to perform the comparison among 2 operands in the vbscript language?
How to get the length of the string by making use of the string function?
i have a problem with this error(this error related edit and
delete button,when i click this button in datagrid..i will
get this error)"Invalid postback or callback argument.
Event validation is enabled using
How to make professional test report using vbscript code in UFT, which gives us complete analysis of the test.
In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?
What are keywords in the vbscript language?
What are the environments supported by vbscript language?
How are values assigned to string type and numeric type variables?
Which loop is used in case of arrays in the vbscript language?
Mention what is the difference between vbscript and vba?
How you can call vbscript functions?