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 / pankaja yathindrakumar
' Script to find if the given number is Prime or Not
Function Prime(n)
If n<=1 Then
Exit Function
Else
Flag="Prime"
For i=2 To n-1
If n Mod i=0 Then
Flag ="Not Prime"
End If
Next
End if
Prime=Flag
End Function
Res=Prime(6)
MsgBox Res
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Like OPTION EXPLICIT statement what are the other statements used in vbscript and their usage. Please post me all the statements please.
Explain about arrays in vb script?
How to capture a runtime error in vbscript?
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?
Write a code to print numbers from 5 to 0?
I have attended Anovatek Software QTP interview. They will give us computer and one web based application with QTP. We have to automate some records (already updated records or new records) using QTP Data driven testing. But we should use for loop? Can any one know how to do data driven testing using For loop?
What is the scope of a constant declared using public?
Which loop is used in case of arrays in the vbscript language?
What are the properties of regexp object?
Explain the functionality of vbscript?
How to write a VBscript for web page performance test i need a code send if any knows the code If any knows VBScript book plz send to me the link to my mail plz
why variable name should not exceed 255 characters?
How to declare an array in vbscript?
Explain the support of asp for vb script functionality?
Write program for identifyig duplicates in flight Departing from and Arriving in mercury tours(web application).