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 / manu

x=inputbox("enter a number")

prime = TRUE
for i = 0 to x-1
if x mod 2 = 0 then
prime = FALSE
end if
next

if prime then
msgbox "prime number"
else
msgbox "not prime"
end if

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

please can you help me to get a code of flames using a visual basic 6

1233


can anyone tell me the procedure of interview held in applabs

1755


What are the different types of loops available in the vbscript language?

536


How to Import data from a file (file is on the desktop) to the data table

1588


why variable name should not exceed 255 characters?

1822






after medical test,when will be the police verification

1720


does anyone have qtp11.0 license key.Please sendit to my mail id-rrvv2011@gmail.com...Thanks

2510


what is the object hyrarchy in QTP for a web based application

1890


How will you get a combined string from array of string in vbscript?

551


Explain the string concatenation function in vbscript?

544


Why is error handling required?

578


Explain the extension .hta?

546


Explain about the support of asp for vb script functionality?

532


write any ttest cases using check points and parameterization

1823


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

12910