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
How can you create an object in vbscript?
does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks
How are values assigned to the variables in the vbscript language?
In html file what is an ideal position to include vbscript?
hi Set myobj=Description.Create() myobj("type").value="submit" myobj("name").value="google search" myobj("html tag").value="button" browser("title:=google").page("title:=google").webButton (myobj).Click i was running above code in one weak back it was working fine i got result,again i opened after few days ,again i was trying to run the code it shows run time error in last line of my code ,why ?pls answer my question?
What is the use of option explicit statement?
What purpose does ‘on error resume next’ serves?
What are subprocedures in vbscript?
Why is the use of exit do or exit for statements within loops discouraged?
What is sql loader? Explain the files used by sql loader to load file?
How to open a file. What is the perpose of true and false mode there?
Why to use option explicit in vb script?
Which event is triggered when mouse focus comes out of an element in the vbscript language?
What is vbscript?
how to set one column as primary key in QTP and fetch values accordingly