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 / anant
boolean isPrime(int num){
if(num==0 || num==1){
System.out.println("Number should be greater than 1");
System.Exit(0);
}
if(num%2==0 || num%3==0 || num%5==0 || num%7==0)
System.out.println("Number is not prime");
else
System.out.println("Number is prime");
}
| Is This Answer Correct ? | 2 Yes | 14 No |
Post New Answer View All Answers
how to automatically update the sql server2005 database records when insert in vb6?
I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?
How to capture a runtime error in vbscript?
What is the use of option explicit statement?
1. How do declare public variable in vb scripts?
What's the difference between vbscript and vb.net?
Explain the support of asp for vb script functionality?
Explain about the functionality of vb script?
What are the differences between sub procedures and function procedures?
How you can call vbscript functions?
how to operate webobjects in a webpage using getobject function and then using generic methods?
What are the uses of vb script?
What is the use of the date function in the vbscript language?
Hi, Can anyone please send me vb script examples to practice vb and also material to learn vb scripting in QTP? my email id : hareen_11@yahoo.com
Explain the extension .hta?