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
what is the features of visual basic?
Mention what is vbscript procedures?
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.
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?
How many types of operators are available in the vbscript language?
Which operator is used to perform the comparison among 2 operands in the vbscript language?
Which constant is used for print and display functions and works as same as pressing enter key?
If else for do while select in vb script?
Explain sga memory structures?
What are subprocedures 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?
how to increase the values in text box in a given text box increament by two values by clicking on button
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?
how to increasing the numbers in a given text box please write a vb script
how to write validation function for date in vb script