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
Explain the functionality of vbscript?
How to identify column in VSFlexgrid? My VSFlexgrid window is identified as 'Active X Control'
Description.Create
what is event handling?
Which operator is used to concatenate the 2 values in the vbscript language?
Explain about vb script?
Mention what is vbscript?
How will you get the exponent of the given number in vbscript?
How will you get a subset of a array in vbscript?
Hi All, I am facing one problem in QTP. There is link object in my application that exist in the Frame in mozilla firefox. Click event on that object is not working but once the frame is enabled/activated then click event works fine.But the frame does not have the activate property. This problem is coming in firefox only. Regards
What is dictionary object in vbscript? Explain?
What are the environments supported by vbscript language?
How many types of procedures are available in the vbscript language?
how to operate webobjects in a webpage using getobject function and then using generic methods?
For a webbased application:- what should be code in expert veiw, for retrieving a single column name "username" from a server and checking whether exported "username" from datatable doesn't exist in server. suppose i have saved in excelsheet a username="gayatri" , which is exported, then checked for whether this username "gayatri" exist in server database or not ? if exist then allow to enter new username, which should be again checked for in loop , or else come out of loop and enter a distinct "username". plz let me have this answer in my id gayatrisahooin@hotmail.com