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
How to capture a runtime error in vbscript?
What is the use of the date function in the vbscript language?
Which function is used to perform string comparison?
Is vbscript language a case-sensitive language and what does it mean?
How to create a function in vbscript?
1. How to handle object implementation change in DP for Ex: i have login page with username,pasword (editboxes),login,cancel(buttons). Here i written DP code for login page with the help properties. My questions: 1.If properites are changing dynamically i will do (i want code for that) 2.if objects are changed dynamcally i will do (i wnat code for that)
What are the 2 ways to pass a value to the function?
How will you get a combined string from array of string in vbscript?
can anyone send me a vb scripts code for clicking on a link and coming back on home page again does the same for many links on a web page.
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.
How are arrays declared in the vbscript language?
Like OPTION EXPLICIT statement what are the other statements used in vbscript and their usage. Please post me all the statements please.
how to answer "TELL ME ABOUT UR SELF" as exp.person. whr to start and whr to stop. can anyone tel me
How will you get the exponent of the given number in vbscript?
Mention what is vbscript?