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 / sayali
Dim prime, n
prime = TRUE
n=cint(inputbox("Enter a number to find whether it is Prime or Not"))
for i=2 to (n-1)
If n mod i = 0 then
prime = False
Exit for
End if
Next
If prime then
msgbox "Yes! It is a Prime number"
Else
msgbox "No! it is not a prime number"
End if
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
if u ve resrevation for train and u get a number supose 1234xxxokie.after sucessul entering all required fields. now u put that number in search and want to chk wether these ar same or not if both ar same then its okie otherwise test fail.what would be the vb script code for it to compare these two values of different page.
Why to use option explicit in vb script?
Explain the functionality of vbscript?
How can you fetch the value of a cookie?
We have 1 web page with names column. I am giving the Service Providers1,2,3.... @ that time dynamically some no of names are displaying in the webpage and The Pop up windows are opening(No.of Pop Up windows=No.of Names). The names may be diffar for each and every Service Provders (Dynamically) How can we handle the Dynamic values?
wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......
Mention how you can call vbscript functions?
Explain the adodb.stream class?
what is resorceallocation
How will you get a string with the specified character the specified number of times in vbscript?
Explain How do you create a recordset object in vbscript?
What are the 2 ways to pass a value to the function?
what is the use of QCUtil? explain with one example?
What is the use of the instr function?
please can you help me to get a code of flames using a visual basic 6