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 are the environments supported by vbscript language?
Mention what if you do not specify anything when you call a procedure?
Can someone please tell me what poor design in a relational database (not the layout or style) is and how it can be avoided? PLEASE...im desperate.
Write a code to print numbers from 5 to 0?
Explain about arrays in vb script?
Explain a few date functions in vbscript
How to pass argument by reference to a function in vbscript?
Explain about vb script?
Which command is used for writing text on a page?
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
In html file what is an ideal position to include vbscript?
I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?
How to create a cookie using vbscript?
write any ttest cases using check points and parameterization
How to make sure that items in a wintree are sorted al?