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
Is vbscript language a case-sensitive language and what does it mean?
filter the array values without using filter function?
1) How can we use VB script in testing the application? 2) What all are the things(Software application to be installed in PC) we need to learn VBscript?
What are lbound and ubound in the vbscript language?
How will you reverse a string in vbscript?
Mention what is the main difference between function and sub-procedure?
How to take whole text output from screen of Bitmap Application.
I am working on QTP, got struck in one place.. In my application depending upon configuration WebEdit count is increasing/ decreasing.. how to get these webedits..
In what way program "hello world" you can write in vbscript?
Why is it recommended to close the database connection every time after the work is completed?
Can anyone send me a vb script function for verifying the functionality of active links on a web page
How will you convert a given number to long in vbscript?
Which function is used in the vbscript language to convert the specified expression into a date type value?
How strcomp function works?
Explain a few date functions in vbscript