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 / anwar basha
n=cint(inputbox("enter the number"))
if n=0 then
msgbox " invalid no"
end if
flag=0
for i=1 to n-1
if n mod i =0 then
falg=1
end if
exit for
next
if falg=1 then
msgbox "not a prime num"
else
msgbox "prime no"
end if
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What aspects of vbscript make it safe so that a web page using vbscript cannot destroy or corrupt information on a user's computer?
how to increase the values in text box in a given text box increament by two values by clicking on button
Which operator can be used to check if two numbers are equal or not in vbscript?
what is the features of visual basic?
What is byref and byval parameters in vbscript?
Sub link() Dim k As Integer Dim rand As Integer Dim URL As String Dim foldernum As Integer Dim folderstring As String Dim filenum As Integer Dim filestring As String k = 1 'for AC Numbers For i = 11 To 40 foldernum = 0 foldernum = 1000 + i folderstring = CStr(foldernum) folderstring = Mid(folderstring, 2, 3) folder = "ac" & folderstring 'folderstring = Sheets(2).Cells(i, 1) ' for Number of Random files For j = 1 To 10 rand = Int(Rnd * (200 - 1) + 1) filenum = 0 filenum = 1000 + rand filestring = CStr(filenum) filestring = Mid(filestring, 2, 3) 'URL = "http://ceobihar.nic.in/PSCDROM/ac" & folderstring & "/i" & folderstring & "0" & filestring & ".pdf" URL = "http://www.elections.tn.gov.in/pdfs/dt1/" & folder & "/" & folder & filestring & ".pdf" ' URL =http://www.wb.nic.in/wbeco/EROLLS/PDF/English/A001/a0010105 .pdf Cells(k, 1) = folderstring Cells(k, 2) = folder Cells(k, 3) = filestring Cells(k, 3) = URL k = k + 1 Next j Next i End Sub plz define it
How can you fetch the value of a cookie?
Which function is used to perform string comparison?
What is the difference between javascript and vbscript?
how to automatically update the sql server2005 database records when insert in vb6?
Explain the tristate constants in vbscript?
Explain the constants in vbscript?
What are the 2 ways in which a variable can be declared in the vbscript language?
I want to run QTP script on Linux server is it possible to do this by connecting Windows to Linux through VPN/Terminal Server and just run the script on Linux server.
What is the use of the date function in the vbscript language?