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
How will you compare two strings in vbscript?
What are subprocedures in vbscript?
give me any information abou vb script books learn quckly
how to comvert 120 into one hunderd twenty rupees only and vice varsa
Explain about constants in vb script?
Write a Program to add 2 numbers without using operators (+,-) and without using third variable. Note: Use VBScript only Hint: You can use other operators like '/' & '*'(Division & Multiplication)
Explain about operator precedence in vb script?
Can automation testing find ssame no. of bugs what we can find by manual testing?
Explain the operator precedence in vb script?
Why is the use of exit do or exit for statements within loops discouraged?
Explain the extension .hta?
Which function is used in the vbscript language to convert the specified expression into a date type value?
What are the different types of operators and their order of precedence?
Explain vbscript in detail?
Mention what if you do not specify anything when you call a procedure?