Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How can you destroy an object in vbscript?

1171


What are the advantages of vbscript?

1142


please can you help me to get a code of flames using a visual basic 6

1860


about vb scripting programs this type of all question& answers

2183


Set srchobj=Description.Create() srchobj("type").value="text" srchobj("name").value="q" srchobj("html tag").value="input" browser("micclass:=google").Page("micclass:=google").webedit (srchobj).Set "qtp" what's wrong in my code pls tell me ? the above code working fine and i got my result pass,now i am trying to run the program it shows general run time error why?pls help me i am in learning stage ?

1964


How to pass argument by reference to a function in vbscript?

1137


Why to use option explicit in vb script?

1101


What are the valid scopes of a variable in vbscript?

1153


How many types of operators are available in the vbscript language?

1009


how to check whether link is disabled in QTP??

6163


Explain the string concatenation function in vbscript?

1101


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

2406


I want to run QTP script on Linux server is it possible to do this by connecting Windows to Linux through VPN/Terminal Server and just run the script on Linux server.

2363


give me any information abou vb script books learn quckly

2270


Explain about the asc function?

1117