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
What is purpose of scripting.filesystemobject class in vbscript?
If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?
after medical test,when will be the police verification
How will you get a string with the specified character the specified number of times 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.
Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.
Explain about scrrun.dll in vbscript?
how to write codings in QTP using vb script. please help me. i am new to QTP. it is easy or very much tough. please tell me
Can automation testing find ssame no. of bugs what we can find by manual testing?
How to Enter Values on the Command promt using VB script
How to get the length of the string by making use of the string function?
can anyone tell me the procedure of interview held in applabs
while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans
For a webbased application:- what should be code in expert veiw, for retrieving a single column name "username" from a server and checking whether exported "username" from datatable doesn't exist in server. suppose i have saved in excelsheet a username="gayatri" , which is exported, then checked for whether this username "gayatri" exist in server database or not ? if exist then allow to enter new username, which should be again checked for in loop , or else come out of loop and enter a distinct "username". plz let me have this answer in my id gayatrisahooin@hotmail.com
What are the rules to name variable in vbscript?