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 / lak
n=inputbox("Enter a Number to check whether the given
number is prime or not")
flag=1
for i=2 to n-1
if n mod i=0 then
flag=0
end if
next
if flag=1 then
msgbox "Prime"
else
msgbox "not prime"
end if
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
regular expression that will recognize a browser as long as its name property starts with mybrowser
What is purpose of scripting.filesystemobject class in vbscript?
create a form to accept username and password validate the username and password with using message box, display the corresponding user message
In html file what is an ideal position to include vbscript?
Mention what is select case statement?
Which operator can be used to change the value of the operand or change the state of the condition?
Which in-built function is used to format the number in the vbscript language?
How to capture a runtime error in vbscript?
What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?
i am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me
Mention how to assign a date value to a variable?
Explain the asc function?
Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder
What are string functions in vbscript?
What is select case statement?