Hi, Anybody could you Please tell me How to write the
script for Checking whether given number is Prime Number or
not..Thanks in Advance
Answer Posted / anwar basha
n=cint(inputbox("enter the number"))
if n=0 then
msgbox " invalid no"
end if
flag=0
for i=1 to n-1
if n mod i =0 then
falg=1
end if
exit for
next
if falg=1 then
msgbox "not a prime num"
else
msgbox "prime no"
end if
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
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
Mention what is byref and byval parameters in vbscript?
Which object is used to work with the database in the vbscript language and what statement is used to create this object?
How will you reverse a string in vbscript?
What is dictionary object in vbscript? Explain?
How to delete a cookie using vbscript?
How to assign a numeric value to a variable?
What are the valid scopes of a variable in vbscript?
when we use filter funtiom invb script(QTP)
When does ‘on click of button’ event gets triggered in the vbscript language?
What is loose binding? Why is it not a good practice to use it?
What are the disadvantages of vbscript?
What is the purpose of regexp object in vbscript?
Mention how to access array data?
Which in-built function is used to format the number in the vbscript language?