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 will you convert a string to upper case string using vbscript?
Explain about adodb.stream class?
Program to use input box and send even numbers into sheet1 and odd numbers into sheet2 and prime numbers into sheet3 using vbscript(QTP)?
Capture the Unique label changes on google home page for I am feeling lucky button and save those label changes to Notepad Note: Using QTP
If a calulator having 3 buttons (of any number)in 3 of them one is not working properly due to which answer is wrong always. write a script to find out which button is not working properly ?
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.
In what way program "hello world" you can write in vbscript?
What is vbscript procedures?
Description.Create
about vb scripting programs this type of all question& answers
while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans
Which data type/types are supported by vbscript language and what are their specialties?
Which function allows you to instantiate an object given its programmatic identifier or progid?
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
What is the difference between javascript and vbscript?