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
What is the use of option explicit in vbscript?
Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?
In the Web page we have a table link, if we click on that link all the contents under that link will be sorted (asscending/Descending). Now i want to check in which order the list is ? for that i need to get the data in to some var How can i get that cells data?
Mention what is the difference between vbscript and vba?
How will you reverse a string in vbscript?
What is the extension of the vbscript file?
Explain vbscript in detail?
Hi Friends my Question is very simple,in Manual testing when we click on a hyper link it directs us to the relavent page or it re-directs us to the current page,so there we can easily write testcase but same thing if we do in automation script using QTP & need to generate report using Reporter.report event how we will do it?thanks in advance...
while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans
Mention what is the technology used by vb script?
Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?
How many types of procedures are available in the vbscript language?
How to assign a numeric value to a variable?
What are the disadvantages of vbscript?
How to create a function in vbscript?