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 ramana reddy

f=0
msgbox "Enter number"
a=inputbox("enter a no")
For i=1 to a
reminder=a mod i
If reminder=0 Then
f=f+1
End If
Next
If f=2 Then
msgbox "the entered number is prime:"&a
else
msgbox "the entered no.is not prime:"&a
End If

Is This Answer Correct ?    19 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to take whole text output from screen of Bitmap Application.

1875


What is the difference between a dictionary and an array?

583


Mention what if you do not specify anything when you call a procedure?

575


Explain the support of asp for vb script functionality?

641


how to check whether link is disabled in QTP??

5635






What are keywords in the vbscript language?

529


Which command is used for writing text on a page?

578


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

1730


How will you get a combined string from array of string in vbscript?

551


How to declare an array in vbscript?

674


Which function allows you to instantiate an object given its programmatic identifier or progid?

566


Out of the different type of operators, which are evaluated first and last in the vbscript language?

569


How will you reverse a string in vbscript?

622


Please let me Know regarding any material regarding VB Scripting which should be easily understandable for Beginners.

1543


what is the use of QCUtil? explain with one example?

6330