Hi, Anybody could you Please tell me How to write the
script for Checking whether given number is Prime Number or
not..Thanks in Advance
Answer Posted / nisar
Dim i,num
num=CInt(InputBox("Enter the numbers to limit the
Prime:"))
i = 3
While i <= num
bIsPrime = True
j = 2
While j <= i\2 And bIsPrime
bIsPrime = i Mod j > 0
j = j + 1
Wend
If bIsPrime Then
Wscript.echo("Found a prime number: " & i)
End If
i = i + 2
Wend
| Is This Answer Correct ? | 0 Yes | 7 No |
Post New Answer View All Answers
Which object is used to work with the excel sheets in the vbscript language and what statement is used to create this object?
How to open a file. What is the perpose of true and false mode there?
Mention what is vbscript?
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?
What is the main difference between function and sub-procedure?
How can you create an object in vbscript?
If else for do while select in vb script?
How can you fetch the value of a cookie?
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.
what is diff between static and dynaic arrys?
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.
How will you get a subset of a array in vbscript?
What is byref and byval parameters in vbscript?
How will you get a string with the specified character the specified number of times in vbscript?
What is the difference between a dictionary and an array?