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 / venkat
n=inputbox("enter the number")
count=0
for i= 1 to n
if n mod i=o Then
count=count+1
Endif
Next
if count=2 Then
Msgbox "number is prime"
Else
Msgbox "number is not prime"
Endif
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
Which function is used to perform string comparison?
How to access array data?
Out of the different type of operators, which are evaluated first and last in the vbscript language?
hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?
What is the output of a + b in vbscript if a = 5 and b = 10?
Mention how to access array data?
who will create the object?
Mention the rules for using option explicit statement?
How will you convert a string to lower case string using vbscript?
What is event handling in vbscript?
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 for fetching the modulus of the 2 numbers in the vbscript language?
what is diff between static and dynaic arrys?
Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?
What is the use of the formatdatetime function in the vbscript language?