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 / mudaseer
vnum=inputbox("enter the number")
for i=2 to vnum-1
if(vnum mod i)=0 then
vf="no"
exit for
else vf="yes"
end if
next
if vf="no" then
msgbox "not a prime"
else
msgbox "it is a prime"
end if
| Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
Give me sm ideas to write Vbscripts abt protocol testing abilash700@gmail.com.
What is the use of the date function in the vbscript language?
Mention how to assign a date value to a variable?
Does VB/Win make standalone .EXE files?
Which function is used to perform string comparison?
what is the differance between BYVAL,BYREF?
Program to use input box and send even numbers into sheet1 and odd numbers into sheet2 and prime numbers into sheet3 using vbscript(QTP)?
What is purpose of scripting.filesystemobject class in vbscript?
What's the difference between vbscript and vb.net?
how does vb script help in web page designing? explain with example.
Hi this is Vinoth. I need a help on below mentioned question A combobox contains list of items assume as 5 I have to get each items Individually and I have to Export to datatable. Please help me on this. Thanks
Which operator is used to concatenate the 2 values in the vbscript language?
Explain about the functionality of vb script?
How to Enter Values on the Command promt using VB script
Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?